sidekiq-middleware 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.md CHANGED
@@ -1,3 +1,8 @@
1
+ 0.1.1
2
+ -----------
3
+
4
+ - Improved lock expiration period for scheduled jobs
5
+
1
6
  0.1.0
2
7
  -----------
3
8
 
data/README.md CHANGED
@@ -38,7 +38,7 @@ class UniqueWorker
38
38
  unique: :all,
39
39
 
40
40
  # Unique expiration (optional, default is 30 minutes)
41
- # For scheduled jobs calculates automatically
41
+ # For scheduled jobs calculates automatically based on schedule time and expiration period
42
42
  expiration: 24 * 60 * 60
43
43
  })
44
44
 
@@ -13,8 +13,9 @@ module Sidekiq
13
13
 
14
14
  # Enabled unique scheduled
15
15
  if enabled == :all && payload.has_key?('at')
16
- scheduled_expiration = (payload['at'].to_i - Time.now.to_i)
17
- expiration = scheduled_expiration if scheduled_expiration > expiration
16
+ # Use expiration period as specified in configuration,
17
+ # but relative to job schedule time
18
+ expiration += (payload['at'].to_i - Time.now.to_i)
18
19
  payload.delete('at')
19
20
  end
20
21
 
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Middleware
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-middleware
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -98,7 +98,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
98
98
  version: '0'
99
99
  segments:
100
100
  - 0
101
- hash: 1078771584105605648
101
+ hash: -293936533653775509
102
102
  required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  none: false
104
104
  requirements:
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  version: '0'
108
108
  segments:
109
109
  - 0
110
- hash: 1078771584105605648
110
+ hash: -293936533653775509
111
111
  requirements: []
112
112
  rubyforge_project:
113
113
  rubygems_version: 1.8.24