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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9331eead88bcd85bcd8e564ce22b5de81b3a43ee
4
- data.tar.gz: b2ae466592349be888d1ff930f344e1b32702587
3
+ metadata.gz: 6bf402d8f9a9fa71478dbaf7d240c132e0eebb07
4
+ data.tar.gz: b372b39855ad6c9c1cd65815cb3b9b1215248bf7
5
5
  SHA512:
6
- metadata.gz: 0b7af459f6a789931ad6a078650449e3efe51641f3b863206a9c99283740bb636010ecc581abd946027773f14fa16f820f1fb6df2cfb90b9476b8f9c2a913109
7
- data.tar.gz: 416c4d0f6c7059fbd40e5aeb8495b46c25f67f919e314196c1df4a8313dd0475d6ea159c229dede39015b282f9ce987c7078bdbf9894494704096412caf47019
6
+ metadata.gz: 9b4352281ee3d6bb49b2c802e6d254f02c6d89ae3224149877bc2db6cd35ff60ac4a0201b824aef0b37b6825fd6e280d0a988c5993085c75e7a17440bb17905a
7
+ data.tar.gz: 7c1fdb476cd81993adb418188d3fb6cec45f625c4a96ac842ff5fbe92cc87d4109aac4e30cbb45d27ff45a7bb1e215691769c82647bdf5a2702b215565ddd4d3
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 0.3.1 / 2016-02-17
2
+
3
+ * Fixed lock refresh checking timeout rather than expiration for finding eligible jobs
4
+
1
5
  ### 0.3.0 / 2016-01-25
2
6
 
3
7
  * Added lock refresh to maintain exclusive locks until long running jobs finish
@@ -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.synchronize_jobs_timeout >= RUN_INTERVAL
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
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Sqeduler
3
- VERSION = "0.3.0".freeze
3
+ VERSION = "0.3.1".freeze
4
4
  end
@@ -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 => 30
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.0
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-01-26 00:00:00.000000000 Z
11
+ date: 2016-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq