sidekiq-unique-jobs 6.0.11 → 6.0.12

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sidekiq-unique-jobs might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4794cab4e8c46ab8a1c2f8d3f1f4a0e40eee2f5c0a78c1750816a4f08298fb3e
4
- data.tar.gz: 5542da14289cd0287001c997b439f77445c9d7b7c13cc8307801a55012217a7c
3
+ metadata.gz: e400e981096ecad506646c8d3d8a57fdbe09628d344cd74bf3d4ebacaa717034
4
+ data.tar.gz: 8eb32a66471a6fc9a8ab9bc5f8717dde2a544151bfb65dedb8214072f9fb14a7
5
5
  SHA512:
6
- metadata.gz: ee3cddb22fa61d68e5b209fbd129c5e8c1c88c3cb02feae0f1d0b869d3722ab9f8e5d08cf0a2d0bbcbb11be2205ee35e5f9202c24eb56cae360e79e4bacd54c9
7
- data.tar.gz: e0c980ae65ac375cf0de4595b61ca4137c52ba0335d947560d7d7550f71db8873a4dca228e18f3319c3cdd551b7377a262133c1d7b66ad8daf9a8143b3fdd4f2
6
+ metadata.gz: 0036cec9334f5d1cf2ac814ed18efaff1adfe3cb372a8b593c686996ccade529faf18258c023313a64373a8d40389707cd5cc3515578f4b2a3062a7e2d9c51f5
7
+ data.tar.gz: b0513ccbbdb7a72fdaea163c6a943df2b97bdcfcd4dad1637f28adfc8eb3f8107fa0a0ca0613ddd21fb0e91f5a82c1822913d9b7663df43f6b7ff739035b26a6
@@ -1,16 +1,44 @@
1
1
  # Change Log
2
2
 
3
- ## [v6.0.10](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.10) (2019-02-23)
4
- [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.9...v6.0.10)
3
+ ## [v6.0.11](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.11) (2019-02-24)
4
+ [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.10...v6.0.11)
5
+
6
+ **Implemented enhancements:**
7
+
8
+ - Reduce leftover keys [\#374](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/374) ([mhenrixon](https://github.com/mhenrixon))
9
+ - Prepare for sidekiq 6 [\#373](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/373) ([mhenrixon](https://github.com/mhenrixon))
10
+
11
+ **Fixed bugs:**
12
+
13
+ - Prevent memory leaks \(many locks stay in memory\) [\#368](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/368)
14
+ - :until\_and\_while\_executing not processing queued jobs after executing [\#355](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/355)
15
+ - Version 6: lets you schedule job with missing arguments [\#351](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/351)
16
+ - Version 6 Ignores Jobs Enqueued in Version 5 [\#345](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/345)
17
+ - Job will not enqueue even with no existing match [\#342](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/342)
18
+ - Convert v5 locks when needed [\#375](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/375) ([mhenrixon](https://github.com/mhenrixon))
19
+ - Reduce leftover keys [\#374](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/374) ([mhenrixon](https://github.com/mhenrixon))
5
20
 
6
21
  **Closed issues:**
7
22
 
8
- - Unsure of sane defaults [\#372](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/372)
23
+ - Infinite lock using until\_and\_while\_executing after sidekiq restart [\#361](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/361)
24
+ - getting a crash using lock\_expiration on v6.0.6 [\#350](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/350)
25
+ - Problem when job failed and is retrying [\#332](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/332)
9
26
 
10
27
  **Merged pull requests:**
11
28
 
29
+ - Clarify lock expiration in readme [\#376](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/376) ([mhenrixon](https://github.com/mhenrixon))
30
+
31
+ ## [v6.0.10](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.10) (2019-02-23)
32
+ [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.9...v6.0.10)
33
+
34
+ **Implemented enhancements:**
35
+
12
36
  - Log job silently complete [\#371](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/371) ([tadejm](https://github.com/tadejm))
13
37
 
38
+ **Closed issues:**
39
+
40
+ - Unsure of sane defaults [\#372](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/372)
41
+
14
42
  ## [v6.0.9](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.9) (2019-02-11)
15
43
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.8...v6.0.9)
16
44
 
@@ -86,13 +86,8 @@ module SidekiqUniqueJobs
86
86
  # @return [true, false]
87
87
  def locked?(token = nil)
88
88
  token ||= jid
89
- Scripts.call(
90
- :convert_legacy_lock,
91
- redis_pool,
92
- keys: [grabbed_key, unique_digest],
93
- argv: [token],
94
- )
95
89
 
90
+ convert_legacy_lock(token)
96
91
  redis(redis_pool) { |conn| conn.hexists(grabbed_key, token) }
97
92
  end
98
93
 
@@ -100,6 +95,15 @@ module SidekiqUniqueJobs
100
95
 
101
96
  attr_reader :unique_digest, :ttl, :jid, :redis_pool, :lock_type
102
97
 
98
+ def convert_legacy_lock(token)
99
+ Scripts.call(
100
+ :convert_legacy_lock,
101
+ redis_pool,
102
+ keys: [grabbed_key, unique_digest],
103
+ argv: [token, current_time.to_f],
104
+ )
105
+ end
106
+
103
107
  def grab_token(timeout = nil)
104
108
  redis(redis_pool) do |conn|
105
109
  if timeout.nil? || timeout.positive?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SidekiqUniqueJobs
4
- VERSION = "6.0.11"
4
+ VERSION = "6.0.12"
5
5
  end
@@ -2,20 +2,12 @@ local grabbed_key = KEYS[1]
2
2
  local unique_digest = KEYS[2]
3
3
 
4
4
  local job_id = ARGV[1]
5
-
6
- local function current_time()
7
- local time = redis.call('time')
8
- local s = time[1]
9
- local ms = time[2]
10
- local number = tonumber((s .. '.' .. ms))
11
-
12
- return number
13
- end
5
+ local current_time = tonumber(ARGV[2])
14
6
 
15
7
  local old_token = redis.call('GET', unique_digest)
16
8
  if old_token then
17
9
  if old_token == job_id or old_token == '2' then
18
10
  redis.call('DEL', unique_digest)
19
- redis.call('HSET', grabbed_key, job_id, current_time())
11
+ redis.call('HSET', grabbed_key, job_id, current_time)
20
12
  end
21
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-unique-jobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.11
4
+ version: 6.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikael Henriksson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-24 00:00:00.000000000 Z
11
+ date: 2019-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby