sqeduler 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +4 -0
- data/lib/sqeduler/lock_maintainer.rb +1 -1
- data/lib/sqeduler/version.rb +1 -1
- data/spec/lock_maintainer_spec.rb +25 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bf402d8f9a9fa71478dbaf7d240c132e0eebb07
|
4
|
+
data.tar.gz: b372b39855ad6c9c1cd65815cb3b9b1215248bf7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b4352281ee3d6bb49b2c802e6d254f02c6d89ae3224149877bc2db6cd35ff60ac4a0201b824aef0b37b6825fd6e280d0a988c5993085c75e7a17440bb17905a
|
7
|
+
data.tar.gz: 7c1fdb476cd81993adb418188d3fb6cec45f625c4a96ac842ff5fbe92cc87d4109aac4e30cbb45d27ff45a7bb1e215691769c82647bdf5a2702b215565ddd4d3
|
data/CHANGES.md
CHANGED
@@ -63,7 +63,7 @@ module Sqeduler
|
|
63
63
|
klass = class_name.constantize
|
64
64
|
if klass.respond_to?(:synchronize_jobs_mode)
|
65
65
|
# We only care about exclusive jobs that are long running
|
66
|
-
if klass.synchronize_jobs_mode == :one_at_a_time && klass.
|
66
|
+
if klass.synchronize_jobs_mode == :one_at_a_time && klass.synchronize_jobs_expiration >= RUN_INTERVAL
|
67
67
|
return @class_with_locks[class_name] = klass
|
68
68
|
end
|
69
69
|
end
|
data/lib/sqeduler/version.rb
CHANGED
@@ -10,7 +10,7 @@ RSpec.describe Sqeduler::LockMaintainer do
|
|
10
10
|
Class.new do
|
11
11
|
include Sidekiq::Worker
|
12
12
|
prepend Sqeduler::Worker::Synchronization
|
13
|
-
synchronize :one_at_a_time, :expiration => 300, :timeout =>
|
13
|
+
synchronize :one_at_a_time, :expiration => 300, :timeout => 5
|
14
14
|
|
15
15
|
def perform(*_args)
|
16
16
|
yield
|
@@ -18,6 +18,19 @@ RSpec.describe Sqeduler::LockMaintainer do
|
|
18
18
|
end
|
19
19
|
)
|
20
20
|
|
21
|
+
stub_const(
|
22
|
+
"SyncShortWorker",
|
23
|
+
Class.new do
|
24
|
+
include Sidekiq::Worker
|
25
|
+
prepend Sqeduler::Worker::Synchronization
|
26
|
+
synchronize :one_at_a_time, :expiration => 5, :timeout => 5
|
27
|
+
|
28
|
+
def perform
|
29
|
+
fail "This shouldn't be called"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
)
|
33
|
+
|
21
34
|
stub_const(
|
22
35
|
"SyncWhateverWorker",
|
23
36
|
Class.new do
|
@@ -75,6 +88,17 @@ RSpec.describe Sqeduler::LockMaintainer do
|
|
75
88
|
}
|
76
89
|
}
|
77
90
|
],
|
91
|
+
[
|
92
|
+
"process-key",
|
93
|
+
"worker-tid-6789",
|
94
|
+
{
|
95
|
+
"run_at" => run_at,
|
96
|
+
"payload" => {
|
97
|
+
"class" => "SyncShortWorker",
|
98
|
+
"args" => job_args
|
99
|
+
}
|
100
|
+
}
|
101
|
+
],
|
78
102
|
[
|
79
103
|
"process-key",
|
80
104
|
"worker-tid-4321",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sqeduler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jared Jenkins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sidekiq
|