sidekiq-unique-jobs 7.0.0.beta27 → 7.0.0.beta28

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: 1f8ac719de8bb615ca9727bc1fcce616e7b4c074c3ea9dee035cbaa0a6883948
4
- data.tar.gz: 98062177539795c85bf3934cfa7c79396a3b9185c927a2506da61bd5cbcd6795
3
+ metadata.gz: 13bc0a51e575fe6e019fa0e47b16875733eaf3c674913caff86c8e9e25b03212
4
+ data.tar.gz: 4798530068d809e896baf5a5091eb81f31f72adec762232e606c3b9c59946889
5
5
  SHA512:
6
- metadata.gz: 0def4f823803bb1c4cce5b93a99ad78b20fa31c563094ad833ce75bcdbafbb415ca27dd8427c6b449063f09e4318e131d97e7111b3925c552791e23d6dabdb01
7
- data.tar.gz: 745df60df4ac33e232703ba12cebeebf8ffe80147d4efcf70879701f399d5b8e714649704356321a3cdac9f181150eae0b5403a80ae9cf4be5d68cc83932989a
6
+ metadata.gz: aad36721efc247b274437dbc327d21bf4c014d482962ce361cad6a7b2fbf63874d32121ac4f2f44d14197169c7c8ac9bb268b7ad8851d2cf407e9c47503524ce
7
+ data.tar.gz: b1308b72466f8a7ec8150e0997eab097c17fcabd7d554811e0ddd3ff547105ff9fa36442318bd9db182a3b6b130e755f6ac4fce93d863cb6c60ae3fe4cadf5c2
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## [Unreleased](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/HEAD)
4
+
5
+ [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta27...HEAD)
6
+
7
+ **Fixed bugs:**
8
+
9
+ - lock\_args does not work when you define the lock\_args argument and default lock\_args function at the same time. [\#548](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/548)
10
+
11
+ ## [v7.0.0.beta27](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta27) (2020-11-03)
12
+
13
+ [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta26...v7.0.0.beta27)
14
+
15
+ **Implemented enhancements:**
16
+
17
+ - Adds coverage for regression purposes [\#550](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/550) ([mhenrixon](https://github.com/mhenrixon))
18
+
19
+ **Fixed bugs:**
20
+
21
+ - Rename lock\_args to lock\_args\_method [\#551](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/551) ([mhenrixon](https://github.com/mhenrixon))
22
+
23
+ **Closed issues:**
24
+
25
+ - Documentation incorrect for `delete\_by\_digest` [\#547](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/547)
26
+ - Locked jobs after kill -9 with while\_executing lock [\#546](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/546)
27
+
3
28
  ## [v7.0.0.beta26](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta26) (2020-10-28)
4
29
 
5
30
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.25...v7.0.0.beta26)
@@ -193,12 +218,15 @@
193
218
  **Fixed bugs:**
194
219
 
195
220
  - Use thread-safe digest creation mechanism [\#484](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/484) ([mhenrixon](https://github.com/mhenrixon))
196
- - Remove digest deletion for concurrent locks [\#482](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/482) ([mhenrixon](https://github.com/mhenrixon))
197
221
 
198
222
  ## [v7.0.0.beta13](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta13) (2020-03-26)
199
223
 
200
224
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta12...v7.0.0.beta13)
201
225
 
226
+ **Fixed bugs:**
227
+
228
+ - Remove digest deletion for concurrent locks [\#482](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/482) ([mhenrixon](https://github.com/mhenrixon))
229
+
202
230
  ## [v7.0.0.beta12](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta12) (2020-03-25)
203
231
 
204
232
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.20...v7.0.0.beta12)
data/README.md CHANGED
@@ -18,7 +18,7 @@
18
18
  - [reaper_count](#reaper_count)
19
19
  - [reaper_interval](#reaper_interval)
20
20
  - [reaper_timeout](#reaper_timeout)
21
- - [unique_prefix](#unique_prefix)
21
+ - [lock_prefix](#lock_prefix)
22
22
  - [lock_info](#lock_info)
23
23
  - [Worker Configuration](#worker-configuration)
24
24
  - [lock_ttl](#lock_ttl-1)
@@ -61,13 +61,13 @@
61
61
 
62
62
  ## Introduction
63
63
 
64
- The goal of this gem is to ensure your Sidekiq jobs are unique. We do this by creating unique keys in Redis based on how you configure uniqueness.
64
+ This gem adds unique constraints to the sidekiq queues. The uniqueness is achieved by acquiring locks for a hash of a queue name, a worker class, and job's arguments. Only one lock for a given hash can be acquired. What happens when a lock can't be acquired is governed by a chosen strategy.
65
65
 
66
66
  This is the documentation for the master branch. You can find the documentation for each release by navigating to its tag.
67
67
 
68
68
  Here are links to some of the old versions
69
69
 
70
- - [v6.0.13](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.13)
70
+ - [v6.0.25](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.25)
71
71
  - [v5.0.10](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v5.0.10)
72
72
  - [v4.0.18](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v4.0.18)
73
73
 
@@ -235,10 +235,10 @@ SidekiqUniqueJobs.config.reaper_timeout #=> 10
235
235
 
236
236
  The number of seconds to wait for the reaper to finish before raising a TimeoutError. This is done to ensure that the next time we reap isn't getting stuck due to the previous process already running.
237
237
 
238
- ### unique_prefix
238
+ ### lock_prefix
239
239
 
240
240
  ```ruby
241
- SidekiqUniqueJobs.config.unique_prefix #=> "uniquejobs"
241
+ SidekiqUniqueJobs.config.lock_prefix #=> "uniquejobs"
242
242
  ```
243
243
 
244
244
  Use if you want a different key prefix for the keys in redis.
@@ -6,7 +6,7 @@ module SidekiqUniqueJobs
6
6
  :lock_timeout,
7
7
  :lock_ttl,
8
8
  :enabled,
9
- :unique_prefix,
9
+ :lock_prefix,
10
10
  :logger,
11
11
  :locks,
12
12
  :strategies,
@@ -127,7 +127,7 @@ module SidekiqUniqueJobs
127
127
  # default_lock_timeout: 0,
128
128
  # default_lock_ttl: nil,
129
129
  # enabled: true,
130
- # unique_prefix: "uniquejobs",
130
+ # lock_prefix: "uniquejobs",
131
131
  # logger: #<Sidekiq::Logger:0x00007f81e096b0e0 @level=1 ...>,
132
132
  # locks: {
133
133
  # around_perform: SidekiqUniqueJobs::Lock::WhileExecuting,
@@ -32,6 +32,7 @@ module SidekiqUniqueJobs
32
32
  ON_CLIENT_CONFLICT ||= "on_client_conflict"
33
33
  ON_CONFLICT ||= "on_conflict"
34
34
  ON_SERVER_CONFLICT ||= "on_server_conflict"
35
+ PAYLOAD ||= "payload"
35
36
  PROCESSES ||= "processes"
36
37
  QUEUE ||= "queue"
37
38
  RETRY ||= "retry"
@@ -52,7 +52,7 @@ module SidekiqUniqueJobs
52
52
  end
53
53
 
54
54
  def add_lock_prefix(item)
55
- item[LOCK_PREFIX] ||= SidekiqUniqueJobs.config.unique_prefix
55
+ item[LOCK_PREFIX] ||= SidekiqUniqueJobs.config.lock_prefix
56
56
  end
57
57
  end
58
58
  end
@@ -43,7 +43,7 @@ module SidekiqUniqueJobs
43
43
  end
44
44
  end
45
45
  ensure
46
- locksmith.unlock
46
+ locksmith.unlock!
47
47
  end
48
48
 
49
49
  private
@@ -87,7 +87,7 @@ module SidekiqUniqueJobs
87
87
  #
88
88
  def lock(&block)
89
89
  redis(redis_pool) do |conn|
90
- return lock_async(conn, &block) if block_given?
90
+ return lock_async(conn, &block) if block
91
91
 
92
92
  lock_sync(conn) do
93
93
  return job_id
@@ -132,7 +132,7 @@ module SidekiqUniqueJobs
132
132
  next unless workers.any?
133
133
 
134
134
  workers.each_pair do |_tid, job|
135
- return true if load_json(job)[LOCK_DIGEST] == digest
135
+ return true if load_json(job).dig(PAYLOAD, LOCK_DIGEST) == digest
136
136
  end
137
137
  end
138
138
 
@@ -168,7 +168,7 @@ module SidekiqUniqueJobs
168
168
  # @option options [Integer] :lock_timeout (default is 0)
169
169
  # @option options [Integer] :lock_ttl (default is 0)
170
170
  # @option options [true,false] :enabled (default is true)
171
- # @option options [String] :unique_prefix (default is 'uniquejobs')
171
+ # @option options [String] :lock_prefix (default is 'uniquejobs')
172
172
  # @option options [Logger] :logger (default is Sidekiq.logger)
173
173
  # @yield control to the caller when given block
174
174
  def configure(options = {})
@@ -3,5 +3,5 @@
3
3
  module SidekiqUniqueJobs
4
4
  #
5
5
  # @return [String] the current SidekiqUniqueJobs version
6
- VERSION = "7.0.0.beta27"
6
+ VERSION = "7.0.0.beta28"
7
7
  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: 7.0.0.beta27
4
+ version: 7.0.0.beta28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikael Henriksson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-03 00:00:00.000000000 Z
11
+ date: 2021-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: brpoplpush-redis_script
@@ -252,7 +252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
252
252
  - !ruby/object:Gem::Version
253
253
  version: 1.3.1
254
254
  requirements: []
255
- rubygems_version: 3.1.2
255
+ rubygems_version: 3.2.4
256
256
  signing_key:
257
257
  specification_version: 4
258
258
  summary: Sidekiq middleware that prevents duplicates jobs