sidekiq-unique-jobs 7.0.0.beta24 → 7.0.0.beta29
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 +4 -4
- data/CHANGELOG.md +121 -23
- data/README.md +55 -35
- data/lib/sidekiq_unique_jobs/batch_delete.rb +1 -1
- data/lib/sidekiq_unique_jobs/changelog.rb +1 -1
- data/lib/sidekiq_unique_jobs/cli.rb +3 -1
- data/lib/sidekiq_unique_jobs/config.rb +2 -2
- data/lib/sidekiq_unique_jobs/connection.rb +1 -1
- data/lib/sidekiq_unique_jobs/constants.rb +5 -1
- data/lib/sidekiq_unique_jobs/digests.rb +1 -1
- data/lib/sidekiq_unique_jobs/exceptions.rb +9 -9
- data/lib/sidekiq_unique_jobs/job.rb +5 -5
- data/lib/sidekiq_unique_jobs/json.rb +1 -1
- data/lib/sidekiq_unique_jobs/key.rb +1 -1
- data/lib/sidekiq_unique_jobs/lock.rb +1 -1
- data/lib/sidekiq_unique_jobs/lock/base_lock.rb +1 -1
- data/lib/sidekiq_unique_jobs/lock/client_validator.rb +1 -1
- data/lib/sidekiq_unique_jobs/lock/server_validator.rb +1 -1
- data/lib/sidekiq_unique_jobs/lock/until_and_while_executing.rb +1 -1
- data/lib/sidekiq_unique_jobs/lock/until_executed.rb +1 -1
- data/lib/sidekiq_unique_jobs/lock/until_executing.rb +1 -1
- data/lib/sidekiq_unique_jobs/lock/until_expired.rb +1 -1
- data/lib/sidekiq_unique_jobs/lock/validator.rb +3 -2
- data/lib/sidekiq_unique_jobs/lock/while_executing.rb +2 -2
- data/lib/sidekiq_unique_jobs/lock/while_executing_reject.rb +1 -1
- data/lib/sidekiq_unique_jobs/lock_args.rb +5 -5
- data/lib/sidekiq_unique_jobs/lock_config.rb +1 -1
- data/lib/sidekiq_unique_jobs/lock_digest.rb +2 -2
- data/lib/sidekiq_unique_jobs/lock_info.rb +1 -1
- data/lib/sidekiq_unique_jobs/lock_timeout.rb +1 -1
- data/lib/sidekiq_unique_jobs/lock_ttl.rb +1 -1
- data/lib/sidekiq_unique_jobs/locksmith.rb +2 -2
- data/lib/sidekiq_unique_jobs/logging.rb +1 -1
- data/lib/sidekiq_unique_jobs/logging/middleware_context.rb +2 -2
- data/lib/sidekiq_unique_jobs/lua/delete_by_digest.lua +1 -1
- data/lib/sidekiq_unique_jobs/middleware.rb +16 -4
- data/lib/sidekiq_unique_jobs/middleware/client.rb +1 -1
- data/lib/sidekiq_unique_jobs/middleware/server.rb +1 -1
- data/lib/sidekiq_unique_jobs/normalizer.rb +1 -1
- data/lib/sidekiq_unique_jobs/on_conflict.rb +1 -1
- data/lib/sidekiq_unique_jobs/on_conflict/log.rb +1 -1
- data/lib/sidekiq_unique_jobs/on_conflict/null_strategy.rb +1 -1
- data/lib/sidekiq_unique_jobs/on_conflict/raise.rb +1 -1
- data/lib/sidekiq_unique_jobs/on_conflict/reject.rb +1 -1
- data/lib/sidekiq_unique_jobs/on_conflict/replace.rb +1 -1
- data/lib/sidekiq_unique_jobs/on_conflict/reschedule.rb +1 -1
- data/lib/sidekiq_unique_jobs/on_conflict/strategy.rb +1 -1
- data/lib/sidekiq_unique_jobs/options_with_fallback.rb +1 -1
- data/lib/sidekiq_unique_jobs/orphans/lua_reaper.rb +1 -1
- data/lib/sidekiq_unique_jobs/orphans/manager.rb +35 -4
- data/lib/sidekiq_unique_jobs/orphans/null_reaper.rb +24 -0
- data/lib/sidekiq_unique_jobs/orphans/observer.rb +2 -2
- data/lib/sidekiq_unique_jobs/orphans/reaper.rb +5 -1
- data/lib/sidekiq_unique_jobs/orphans/ruby_reaper.rb +4 -2
- data/lib/sidekiq_unique_jobs/profiler.rb +1 -1
- data/lib/sidekiq_unique_jobs/redis.rb +1 -1
- data/lib/sidekiq_unique_jobs/redis/entity.rb +1 -1
- data/lib/sidekiq_unique_jobs/redis/hash.rb +1 -1
- data/lib/sidekiq_unique_jobs/redis/list.rb +1 -1
- data/lib/sidekiq_unique_jobs/redis/set.rb +1 -1
- data/lib/sidekiq_unique_jobs/redis/sorted_set.rb +1 -1
- data/lib/sidekiq_unique_jobs/redis/string.rb +1 -1
- data/lib/sidekiq_unique_jobs/rspec/matchers.rb +2 -2
- data/lib/sidekiq_unique_jobs/rspec/matchers/have_valid_sidekiq_options.rb +2 -2
- data/lib/sidekiq_unique_jobs/script.rb +1 -1
- data/lib/sidekiq_unique_jobs/script/caller.rb +2 -2
- data/lib/sidekiq_unique_jobs/sidekiq_unique_ext.rb +5 -5
- data/lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb +2 -2
- data/lib/sidekiq_unique_jobs/sidekiq_worker_methods.rb +2 -2
- data/lib/sidekiq_unique_jobs/testing.rb +2 -1
- data/lib/sidekiq_unique_jobs/timing.rb +1 -1
- data/lib/sidekiq_unique_jobs/unlockable.rb +1 -1
- data/lib/sidekiq_unique_jobs/update_version.rb +1 -1
- data/lib/sidekiq_unique_jobs/upgrade_locks.rb +1 -1
- data/lib/sidekiq_unique_jobs/version.rb +1 -1
- data/lib/sidekiq_unique_jobs/version_check.rb +1 -1
- data/lib/sidekiq_unique_jobs/web.rb +5 -12
- data/lib/sidekiq_unique_jobs/web/helpers.rb +1 -1
- metadata +19 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e4cfefa54c02030937149283e2e84a7aded65849e746bc983492228372789c4
|
4
|
+
data.tar.gz: 2078532d9b1827981f8d86d9df0217312390463696250e12b6629f456b4c4c3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb076efaa48a127d059083ee9bdd046a64ec0b1ee16d0b92a63a9e5024219b9513e302d188d38e858f629cc75304c40597d36e811c66ec3b0b233816e89d67e9
|
7
|
+
data.tar.gz: 1c449810c1a35384e0e147930309514ceb463880d570fbf05c3f6cf0bbb87c48f2a9bc38e120674d0d372509b87ba579fd5703298e5cf7e6f209a63b63df27f2
|
data/CHANGELOG.md
CHANGED
@@ -2,11 +2,109 @@
|
|
2
2
|
|
3
3
|
## [Unreleased](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/HEAD)
|
4
4
|
|
5
|
-
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.
|
5
|
+
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta28...HEAD)
|
6
6
|
|
7
7
|
**Closed issues:**
|
8
8
|
|
9
|
+
- Ruby Reaper active check incorrect [\#557](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/557)
|
10
|
+
|
11
|
+
## [v7.0.0.beta28](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta28) (2021-01-07)
|
12
|
+
|
13
|
+
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta27...v7.0.0.beta28)
|
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
|
+
- 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)
|
22
|
+
- incorrect `:while\_executing` behavior [\#432](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/432)
|
23
|
+
- Fix active check for the worker hash [\#558](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/558) ([mhenrixon](https://github.com/mhenrixon))
|
24
|
+
- Prefer lock\_prefix not unique\_prefix [\#554](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/554) ([mhenrixon](https://github.com/mhenrixon))
|
25
|
+
- Fix issue 432 [\#552](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/552) ([mhenrixon](https://github.com/mhenrixon))
|
26
|
+
|
27
|
+
## [v7.0.0.beta27](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta27) (2020-11-03)
|
28
|
+
|
29
|
+
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta26...v7.0.0.beta27)
|
30
|
+
|
31
|
+
**Fixed bugs:**
|
32
|
+
|
33
|
+
- Rename lock\_args to lock\_args\_method [\#551](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/551) ([mhenrixon](https://github.com/mhenrixon))
|
34
|
+
|
35
|
+
**Closed issues:**
|
36
|
+
|
37
|
+
- Documentation incorrect for `delete\_by\_digest` [\#547](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/547)
|
38
|
+
- Locked jobs after kill -9 with while\_executing lock [\#546](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/546)
|
39
|
+
|
40
|
+
## [v7.0.0.beta26](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta26) (2020-10-28)
|
41
|
+
|
42
|
+
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.25...v7.0.0.beta26)
|
43
|
+
|
44
|
+
**Implemented enhancements:**
|
45
|
+
|
46
|
+
- How to disable Reaper [\#543](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/543)
|
47
|
+
- Allow disabling of reaper [\#544](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/544) ([mhenrixon](https://github.com/mhenrixon))
|
48
|
+
|
49
|
+
**Merged pull requests:**
|
50
|
+
|
51
|
+
- Update sidekiq-unique-jobs.gemspec [\#542](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/542) ([sergey-alekseev](https://github.com/sergey-alekseev))
|
52
|
+
|
53
|
+
## [v6.0.25](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.25) (2020-10-26)
|
54
|
+
|
55
|
+
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta25...v6.0.25)
|
56
|
+
|
57
|
+
**Implemented enhancements:**
|
58
|
+
|
59
|
+
- Support apartment [\#541](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/541) ([mhenrixon](https://github.com/mhenrixon))
|
60
|
+
- Support both instance method and class method [\#528](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/528) ([mhenrixon](https://github.com/mhenrixon))
|
61
|
+
|
62
|
+
## [v7.0.0.beta25](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta25) (2020-10-26)
|
63
|
+
|
64
|
+
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta24...v7.0.0.beta25)
|
65
|
+
|
66
|
+
**Implemented enhancements:**
|
67
|
+
|
68
|
+
- Bump rubocop [\#539](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/539) ([mhenrixon](https://github.com/mhenrixon))
|
69
|
+
- Support both instance method and class method [\#527](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/527) ([mhenrixon](https://github.com/mhenrixon))
|
70
|
+
|
71
|
+
**Fixed bugs:**
|
72
|
+
|
73
|
+
- Ruby reaper not working, active jobs queried incorrectly [\#537](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/537)
|
74
|
+
- Fix RubyReaper active? [\#538](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/538) ([tanner-rutgers](https://github.com/tanner-rutgers))
|
75
|
+
|
76
|
+
**Closed issues:**
|
77
|
+
|
78
|
+
- ConnectionPool::TimeoutError and :until\_executed [\#535](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/535)
|
79
|
+
|
80
|
+
**Merged pull requests:**
|
81
|
+
|
82
|
+
- Support apartment [\#540](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/540) ([mhenrixon](https://github.com/mhenrixon))
|
83
|
+
|
84
|
+
## [v7.0.0.beta24](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta24) (2020-09-27)
|
85
|
+
|
86
|
+
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta23...v7.0.0.beta24)
|
87
|
+
|
88
|
+
**Closed issues:**
|
89
|
+
|
90
|
+
- Leaked keys in version 5.0.10 [\#519](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/519)
|
91
|
+
|
92
|
+
## [v7.0.0.beta23](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta23) (2020-06-23)
|
93
|
+
|
94
|
+
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.23...v7.0.0.beta23)
|
95
|
+
|
96
|
+
**Fixed bugs:**
|
97
|
+
|
98
|
+
- Exit early when no results are returned from LRANGE given jobs might already processed [\#521](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/521) ([vipulnsward](https://github.com/vipulnsward))
|
99
|
+
|
100
|
+
## [v6.0.23](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.23) (2020-06-23)
|
101
|
+
|
102
|
+
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta22...v6.0.23)
|
103
|
+
|
104
|
+
**Fixed bugs:**
|
105
|
+
|
9
106
|
- Ruby reaper incorrectly checks active jobs — removes every active lock as result [\#517](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/517)
|
107
|
+
- Backport \#465 to 6.x series [\#520](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/520) ([replaid](https://github.com/replaid))
|
10
108
|
|
11
109
|
## [v7.0.0.beta22](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta22) (2020-06-12)
|
12
110
|
|
@@ -50,6 +148,10 @@
|
|
50
148
|
|
51
149
|
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta18...v7.0.0.beta19)
|
52
150
|
|
151
|
+
**Implemented enhancements:**
|
152
|
+
|
153
|
+
- Try GitHub actions [\#505](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/505) ([mhenrixon](https://github.com/mhenrixon))
|
154
|
+
|
53
155
|
**Fixed bugs:**
|
54
156
|
|
55
157
|
- Expire reaper when not checking in [\#508](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/508) ([mhenrixon](https://github.com/mhenrixon))
|
@@ -66,10 +168,6 @@
|
|
66
168
|
|
67
169
|
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta16...v7.0.0.beta17)
|
68
170
|
|
69
|
-
**Implemented enhancements:**
|
70
|
-
|
71
|
-
- Try GitHub actions [\#505](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/505) ([mhenrixon](https://github.com/mhenrixon))
|
72
|
-
|
73
171
|
**Fixed bugs:**
|
74
172
|
|
75
173
|
- Deep stringify worker options to account for hash in on\_conflict [\#506](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/506) ([jasonbekolay](https://github.com/jasonbekolay))
|
@@ -80,7 +178,6 @@
|
|
80
178
|
|
81
179
|
**Fixed bugs:**
|
82
180
|
|
83
|
-
- Deprecate configuration options with `default\_` [\#504](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/504) ([mhenrixon](https://github.com/mhenrixon))
|
84
181
|
- Fix access to both server and client conflict [\#503](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/503) ([mhenrixon](https://github.com/mhenrixon))
|
85
182
|
|
86
183
|
**Closed issues:**
|
@@ -110,6 +207,7 @@
|
|
110
207
|
- Brpoplpush::RedisScript::LuaError: WRONGTYPE Operation against a key holding the wrong kind of value [\#491](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/491)
|
111
208
|
- Lua script bug [\#489](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/489)
|
112
209
|
- Reaper will delete locks for running jobs [\#488](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/488)
|
210
|
+
- Deprecate configuration options with `default\_` [\#504](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/504) ([mhenrixon](https://github.com/mhenrixon))
|
113
211
|
- Fix access to hash members [\#496](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/496) ([mhenrixon](https://github.com/mhenrixon))
|
114
212
|
- Fix cursor assignment [\#494](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/494) ([mhenrixon](https://github.com/mhenrixon))
|
115
213
|
- Prevent reaping of active jobs [\#493](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/493) ([mhenrixon](https://github.com/mhenrixon))
|
@@ -160,10 +258,6 @@
|
|
160
258
|
- Please keep some recent versions on rubygems.org [\#478](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/478)
|
161
259
|
- validate\_worker! throws error [\#466](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/466)
|
162
260
|
|
163
|
-
**Merged pull requests:**
|
164
|
-
|
165
|
-
- Allow v7 configuration to work [\#479](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/479) ([mhenrixon](https://github.com/mhenrixon))
|
166
|
-
|
167
261
|
## [v7.0.0.beta11](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta11) (2020-03-21)
|
168
262
|
|
169
263
|
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta10...v7.0.0.beta11)
|
@@ -190,6 +284,7 @@
|
|
190
284
|
|
191
285
|
**Merged pull requests:**
|
192
286
|
|
287
|
+
- Allow v7 configuration to work [\#479](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/479) ([mhenrixon](https://github.com/mhenrixon))
|
193
288
|
- README: Use SVG badges ✨ [\#470](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/470) ([olleolleolle](https://github.com/olleolleolle))
|
194
289
|
- remove deprecated/broken OptionsWithFallback\#unique\_type [\#435](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/435) ([zvkemp](https://github.com/zvkemp))
|
195
290
|
|
@@ -200,7 +295,6 @@
|
|
200
295
|
**Fixed bugs:**
|
201
296
|
|
202
297
|
- Fix access to lock [\#476](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/476) ([mhenrixon](https://github.com/mhenrixon))
|
203
|
-
- Backport v7 fix for conflicts [\#461](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/461) ([mhenrixon](https://github.com/mhenrixon))
|
204
298
|
|
205
299
|
## [v7.0.0.beta9](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta9) (2019-12-04)
|
206
300
|
|
@@ -211,6 +305,10 @@
|
|
211
305
|
- Keys without TTL [\#417](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/417)
|
212
306
|
- Various changes to test and verify reliability [\#463](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/463) ([mhenrixon](https://github.com/mhenrixon))
|
213
307
|
|
308
|
+
**Fixed bugs:**
|
309
|
+
|
310
|
+
- Make deletion compatible with redis-namespace [\#452](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/452) ([mhenrixon](https://github.com/mhenrixon))
|
311
|
+
|
214
312
|
**Closed issues:**
|
215
313
|
|
216
314
|
- until\_and\_while\_executing with sidekiq pro `reliable\_scheduler!` [\#411](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/411)
|
@@ -241,6 +339,7 @@
|
|
241
339
|
**Fixed bugs:**
|
242
340
|
|
243
341
|
- A worker with "While Executing" lock and "Reschedule" strategy is rescheduled forever [\#457](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/457)
|
342
|
+
- Backport v7 fix for conflicts [\#461](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/461) ([mhenrixon](https://github.com/mhenrixon))
|
244
343
|
- Prevent callbacks from preventing locks [\#460](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/460) ([mhenrixon](https://github.com/mhenrixon))
|
245
344
|
|
246
345
|
## [v7.0.0.beta6](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta6) (2019-11-28)
|
@@ -282,8 +381,8 @@
|
|
282
381
|
**Fixed bugs:**
|
283
382
|
|
284
383
|
- Prevent multiple reapers [\#453](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/453) ([mhenrixon](https://github.com/mhenrixon))
|
285
|
-
- Make deletion compatible with redis-namespace [\#452](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/452) ([mhenrixon](https://github.com/mhenrixon))
|
286
384
|
- Make sure server process stays locked [\#448](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/448) ([mhenrixon](https://github.com/mhenrixon))
|
385
|
+
- Make the ruby reaper plain ruby [\#443](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/443) ([mhenrixon](https://github.com/mhenrixon))
|
287
386
|
|
288
387
|
**Merged pull requests:**
|
289
388
|
|
@@ -321,11 +420,11 @@
|
|
321
420
|
|
322
421
|
- Brpoplpush redis script [\#434](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/434) ([mhenrixon](https://github.com/mhenrixon))
|
323
422
|
- Drop support for almost EOL ruby 2.4 [\#433](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/433) ([mhenrixon](https://github.com/mhenrixon))
|
423
|
+
- Bump ruby versions in Travis CI [\#425](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/425) ([giraffate](https://github.com/giraffate))
|
324
424
|
|
325
425
|
**Fixed bugs:**
|
326
426
|
|
327
427
|
- Redis is busy running script and script never terminates [\#441](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/441)
|
328
|
-
- Make the ruby reaper plain ruby [\#443](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/443) ([mhenrixon](https://github.com/mhenrixon))
|
329
428
|
|
330
429
|
**Closed issues:**
|
331
430
|
|
@@ -353,13 +452,11 @@
|
|
353
452
|
|
354
453
|
**Implemented enhancements:**
|
355
454
|
|
356
|
-
- Bump ruby versions in Travis CI [\#425](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/425) ([giraffate](https://github.com/giraffate))
|
357
455
|
- Allow lock info to be configured from worker [\#407](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/407) ([mhenrixon](https://github.com/mhenrixon))
|
358
456
|
- Validate worker configuration [\#406](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/406) ([mhenrixon](https://github.com/mhenrixon))
|
359
457
|
- Codeclimate configuration [\#405](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/405) ([mhenrixon](https://github.com/mhenrixon))
|
360
458
|
- Ensure uniquejobs namespace [\#400](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/400) ([mhenrixon](https://github.com/mhenrixon))
|
361
459
|
- Prepare for version 7 [\#387](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/387) ([mhenrixon](https://github.com/mhenrixon))
|
362
|
-
- Provide some configuration DSL for custom Strategies and Locks [\#383](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/383) ([mberlanda](https://github.com/mberlanda))
|
363
460
|
|
364
461
|
**Fixed bugs:**
|
365
462
|
|
@@ -417,7 +514,7 @@
|
|
417
514
|
**Closed issues:**
|
418
515
|
|
419
516
|
- Unique args in combination with sidekiq cron contains `\_aj\_symbol\_keys` [\#363](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/363)
|
420
|
-
- Low quality
|
517
|
+
- Low quality piece of shit [\#360](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/360)
|
421
518
|
- Passthrough has been deprecated and will be removed in redis-namespace 2.0 [\#338](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/338)
|
422
519
|
|
423
520
|
## [v6.0.12](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.12) (2019-02-28)
|
@@ -435,6 +532,7 @@
|
|
435
532
|
|
436
533
|
**Implemented enhancements:**
|
437
534
|
|
535
|
+
- Provide some configuration DSL for custom Strategies and Locks [\#383](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/383) ([mberlanda](https://github.com/mberlanda))
|
438
536
|
- Reduce leftover keys [\#374](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/374) ([mhenrixon](https://github.com/mhenrixon))
|
439
537
|
- Prepare for sidekiq 6 [\#373](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/373) ([mhenrixon](https://github.com/mhenrixon))
|
440
538
|
|
@@ -695,6 +793,7 @@
|
|
695
793
|
**Implemented enhancements:**
|
696
794
|
|
697
795
|
- Prepare for v6 [\#286](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/286) ([mhenrixon](https://github.com/mhenrixon))
|
796
|
+
- Only unlock not delete [\#285](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/285) ([mhenrixon](https://github.com/mhenrixon))
|
698
797
|
|
699
798
|
## [v6.0.0.rc3](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0.rc3) (2018-06-29)
|
700
799
|
|
@@ -712,7 +811,6 @@
|
|
712
811
|
|
713
812
|
- Within tests: workers enqueued in the future don't clear their unique locks after being drained/executed [\#254](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/254)
|
714
813
|
- Unexpected behavior with until\_executed [\#250](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/250)
|
715
|
-
- Only unlock not delete [\#285](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/285) ([mhenrixon](https://github.com/mhenrixon))
|
716
814
|
|
717
815
|
**Fixed bugs:**
|
718
816
|
|
@@ -742,7 +840,6 @@
|
|
742
840
|
- Legacy support [\#280](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/280)
|
743
841
|
- Adds legacy support [\#281](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/281) ([mhenrixon](https://github.com/mhenrixon))
|
744
842
|
- Adds guard-reek [\#279](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/279) ([mhenrixon](https://github.com/mhenrixon))
|
745
|
-
- Fix UntilExpired [\#278](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/278) ([mhenrixon](https://github.com/mhenrixon))
|
746
843
|
|
747
844
|
## [v6.0.0.beta2](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0.beta2) (2018-06-25)
|
748
845
|
|
@@ -762,7 +859,6 @@
|
|
762
859
|
- Code smells [\#275](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/275) ([mhenrixon](https://github.com/mhenrixon))
|
763
860
|
- Reject while scheduling [\#273](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/273) ([mhenrixon](https://github.com/mhenrixon))
|
764
861
|
- Improve testing [\#272](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/272) ([mhenrixon](https://github.com/mhenrixon))
|
765
|
-
- Solidify master [\#270](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/270) ([mhenrixon](https://github.com/mhenrixon))
|
766
862
|
|
767
863
|
## [v6.0.0.beta](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0.beta) (2018-06-17)
|
768
864
|
|
@@ -770,7 +866,9 @@
|
|
770
866
|
|
771
867
|
**Implemented enhancements:**
|
772
868
|
|
869
|
+
- Fix UntilExpired [\#278](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/278) ([mhenrixon](https://github.com/mhenrixon))
|
773
870
|
- Until and while executing [\#271](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/271) ([mhenrixon](https://github.com/mhenrixon))
|
871
|
+
- Solidify master [\#270](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/270) ([mhenrixon](https://github.com/mhenrixon))
|
774
872
|
- Minor adjustments [\#268](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/268) ([mhenrixon](https://github.com/mhenrixon))
|
775
873
|
- Use ruby 2.5.1 [\#267](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/267) ([mhenrixon](https://github.com/mhenrixon))
|
776
874
|
- Add explicit concurrent-ruby dependency. [\#265](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/265) ([brettburley](https://github.com/brettburley))
|
@@ -855,7 +953,6 @@
|
|
855
953
|
|
856
954
|
- Different unique arguments depending on lock type [\#203](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/203)
|
857
955
|
- Strategy until\_and\_while\_executing not working properly [\#199](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/199)
|
858
|
-
- while\_executing working wrong [\#193](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/193)
|
859
956
|
|
860
957
|
## [v5.0.5](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v5.0.5) (2017-04-23)
|
861
958
|
|
@@ -917,6 +1014,7 @@
|
|
917
1014
|
|
918
1015
|
- Could not find a valid gem 'sidekiq-unique-jobs' \(= 3.0.15\) in any repository [\#197](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/197)
|
919
1016
|
- `uniquejobs` hash doesn't get cleaned up [\#195](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/195)
|
1017
|
+
- while\_executing working wrong [\#193](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/193)
|
920
1018
|
- Code block under "Finer Control over Uniqueness" in your documentation might have the wrong option specified [\#191](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/191)
|
921
1019
|
- not able to run test without live Redis [\#186](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/186)
|
922
1020
|
- unique while not sucessfully completed? [\#185](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/185)
|
@@ -931,7 +1029,6 @@
|
|
931
1029
|
- Increase sleep delay in WhileExecuting\#synchronize [\#204](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/204) ([dsander](https://github.com/dsander))
|
932
1030
|
- Ensure job ID removed from uniquejobs hash [\#200](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/200) ([carlosmartinez](https://github.com/carlosmartinez))
|
933
1031
|
- unique args need to be an array [\#194](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/194) ([pboling](https://github.com/pboling))
|
934
|
-
- fix for \#168. Handle the NOSCRIPT by sending the script again [\#178](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/178) ([otzy007](https://github.com/otzy007))
|
935
1032
|
|
936
1033
|
## [v4.0.18](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v4.0.18) (2016-07-24)
|
937
1034
|
|
@@ -954,6 +1051,7 @@
|
|
954
1051
|
|
955
1052
|
- missed space [\#188](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/188) ([TheBigSadowski](https://github.com/TheBigSadowski))
|
956
1053
|
- Convert unless if to just 1 if [\#179](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/179) ([otzy007](https://github.com/otzy007))
|
1054
|
+
- fix for \#168. Handle the NOSCRIPT by sending the script again [\#178](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/178) ([otzy007](https://github.com/otzy007))
|
957
1055
|
- Fixed gitter badge link [\#176](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/176) ([andrew](https://github.com/andrew))
|
958
1056
|
|
959
1057
|
## [v4.0.17](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v4.0.17) (2016-03-02)
|
@@ -1055,6 +1153,7 @@
|
|
1055
1153
|
**Merged pull requests:**
|
1056
1154
|
|
1057
1155
|
- Calculate worker's unique args when a proc or a symbol is specified [\#143](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/143) ([zeqfreed](https://github.com/zeqfreed))
|
1156
|
+
- Fix markdown link formatting [\#134](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/134) ([thbar](https://github.com/thbar))
|
1058
1157
|
|
1059
1158
|
## [v4.0.7](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v4.0.7) (2015-10-14)
|
1060
1159
|
|
@@ -1085,8 +1184,6 @@
|
|
1085
1184
|
|
1086
1185
|
**Merged pull requests:**
|
1087
1186
|
|
1088
|
-
- Fix markdown link formatting [\#134](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/134) ([thbar](https://github.com/thbar))
|
1089
|
-
- Forces to look for testing namespace in Sidekiq and not his ancestors [\#129](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/129) ([antek-drzewiecki](https://github.com/antek-drzewiecki))
|
1090
1187
|
- Fix outdated phrasing and add test coverage to readme [\#123](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/123) ([albertyw](https://github.com/albertyw))
|
1091
1188
|
|
1092
1189
|
## [v4.0.4](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v4.0.4) (2015-10-09)
|
@@ -1177,6 +1274,7 @@
|
|
1177
1274
|
|
1178
1275
|
**Merged pull requests:**
|
1179
1276
|
|
1277
|
+
- Forces to look for testing namespace in Sidekiq and not his ancestors [\#129](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/129) ([antek-drzewiecki](https://github.com/antek-drzewiecki))
|
1180
1278
|
- Allow job with jid matching unique lock to pass unique check [\#105](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/105) ([deltaroe](https://github.com/deltaroe))
|
1181
1279
|
- Prevent Jobs from deleting mutexes they don't own [\#96](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/96) ([pik](https://github.com/pik))
|
1182
1280
|
- Add after unlock hook [\#92](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/92) ([HParker](https://github.com/HParker))
|
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
|
-
- [
|
21
|
+
- [lock_prefix](#lock_prefix)
|
22
22
|
- [lock_info](#lock_info)
|
23
23
|
- [Worker Configuration](#worker-configuration)
|
24
24
|
- [lock_ttl](#lock_ttl-1)
|
@@ -33,15 +33,27 @@
|
|
33
33
|
- [While Executing](#while-executing)
|
34
34
|
- [Custom Locks](#custom-locks)
|
35
35
|
- [Conflict Strategy](#conflict-strategy)
|
36
|
-
- [
|
37
|
-
- [
|
38
|
-
- [
|
39
|
-
- [
|
40
|
-
- [
|
41
|
-
- [
|
42
|
-
- [
|
43
|
-
- [
|
44
|
-
- [
|
36
|
+
- [log](#log)
|
37
|
+
- [raise](#raise)
|
38
|
+
- [reject](#reject)
|
39
|
+
- [replace](#replace)
|
40
|
+
- [Reschedule](#reschedule)
|
41
|
+
- [Custom Strategies](#custom-strategies)
|
42
|
+
- [Usage](#usage)
|
43
|
+
- [Finer Control over Uniqueness](#finer-control-over-uniqueness)
|
44
|
+
- [After Unlock Callback](#after-unlock-callback)
|
45
|
+
- [Logging](#logging)
|
46
|
+
- [Cleanup Dead Locks](#cleanup-dead-locks)
|
47
|
+
- [Other Sidekiq gems](#other-sidekiq-gems)
|
48
|
+
- [sidekiq-global_id](#sidekiq-global_id)
|
49
|
+
- [Debugging](#debugging)
|
50
|
+
- [Sidekiq Web](#sidekiq-web)
|
51
|
+
- [Show Locks](#show-locks)
|
52
|
+
- [Show Lock](#show-lock)
|
53
|
+
- [Communication](#communication)
|
54
|
+
- [Testing](#testing)
|
55
|
+
- [Unique Sidekiq Configuration](#unique-sidekiq-configuration)
|
56
|
+
- [Uniqueness](#uniqueness)
|
45
57
|
- [Contributing](#contributing)
|
46
58
|
- [Contributors](#contributors)
|
47
59
|
|
@@ -49,13 +61,13 @@
|
|
49
61
|
|
50
62
|
## Introduction
|
51
63
|
|
52
|
-
The
|
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.
|
53
65
|
|
54
66
|
This is the documentation for the master branch. You can find the documentation for each release by navigating to its tag.
|
55
67
|
|
56
68
|
Here are links to some of the old versions
|
57
69
|
|
58
|
-
- [v6.0.
|
70
|
+
- [v6.0.25](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.25)
|
59
71
|
- [v5.0.10](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v5.0.10)
|
60
72
|
- [v4.0.18](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v4.0.18)
|
61
73
|
|
@@ -106,6 +118,8 @@ See [Locking & Unlocking](https://github.com/mhenrixon/sidekiq-unique-jobs/wiki/
|
|
106
118
|
|
107
119
|
The gem supports a few different configuration options that might be of interest if you run into some weird issues.
|
108
120
|
|
121
|
+
Configure SidekiqUniqueJobs in an initializer or the sidekiq initializer on application startup.
|
122
|
+
|
109
123
|
```ruby
|
110
124
|
SidekiqUniqueJobs.configure do |config|
|
111
125
|
config.debug_lua = true
|
@@ -189,6 +203,14 @@ On the other hand if I increase it to 10 000 orphaned locks per cleanup (`reaper
|
|
189
203
|
|
190
204
|
> BUSY Redis is busy running a script. You can only call SCRIPT KILL or SHUTDOWN NOSAVE. (Redis::CommandError)
|
191
205
|
|
206
|
+
If you want to disable the reaper set it to `:none`, `nil` or `false`. Actually, any value that isn't `:ruby` or `:lua` will disable the reaping.
|
207
|
+
|
208
|
+
```ruby
|
209
|
+
SidekiqUniqueJobs.config.reaper = :none
|
210
|
+
SidekiqUniqueJobs.config.reaper = nil
|
211
|
+
SidekiqUniqueJobs.config.reaper = false
|
212
|
+
```
|
213
|
+
|
192
214
|
### reaper_count
|
193
215
|
|
194
216
|
```ruby
|
@@ -213,10 +235,10 @@ SidekiqUniqueJobs.config.reaper_timeout #=> 10
|
|
213
235
|
|
214
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.
|
215
237
|
|
216
|
-
###
|
238
|
+
### lock_prefix
|
217
239
|
|
218
240
|
```ruby
|
219
|
-
SidekiqUniqueJobs.config.
|
241
|
+
SidekiqUniqueJobs.config.lock_prefix #=> "uniquejobs"
|
220
242
|
```
|
221
243
|
|
222
244
|
Use if you want a different key prefix for the keys in redis.
|
@@ -383,11 +405,9 @@ You can refer on all the locks defined in `lib/sidekiq_unique_jobs/lock/*.rb`.
|
|
383
405
|
|
384
406
|
In order to make it available, you should call in your project startup:
|
385
407
|
|
386
|
-
|
387
|
-
# For rails application
|
388
|
-
# config/initializers/sidekiq_unique_jobs.rb
|
389
|
-
# For other projects, whenever you prefer
|
408
|
+
(For rails application config/initializers/sidekiq_unique_jobs.rb or other projects, wherever you prefer)
|
390
409
|
|
410
|
+
```ruby
|
391
411
|
SidekiqUniqueJobs.configure do |config|
|
392
412
|
config.add_lock :my_custom_lock, Locks::MyCustomLock
|
393
413
|
end
|
@@ -408,7 +428,9 @@ The last one is log which can be be used with the lock `UntilExecuted` and `Unti
|
|
408
428
|
It is possible for locks to have different conflict strategy for the client and server. This is useful for `:until_and_while_executing`.
|
409
429
|
|
410
430
|
```ruby
|
411
|
-
sidekiq_options lock: :until_and_while_executing,
|
431
|
+
sidekiq_options lock: :until_and_while_executing,
|
432
|
+
on_conflict: { client: :log, server: :reject }
|
433
|
+
```
|
412
434
|
|
413
435
|
### log
|
414
436
|
|
@@ -474,11 +496,9 @@ You can refer to all the strategies defined in `lib/sidekiq_unique_jobs/on_confl
|
|
474
496
|
|
475
497
|
In order to make it available, you should call in your project startup:
|
476
498
|
|
477
|
-
|
478
|
-
# For rails application
|
479
|
-
# config/initializers/sidekiq_unique_jobs.rb
|
480
|
-
# For other projects, whenever you prefer
|
499
|
+
(For rails application config/initializers/sidekiq_unique_jobs.rb for other projects, wherever you prefer)
|
481
500
|
|
501
|
+
```ruby
|
482
502
|
SidekiqUniqueJobs.configure do |config|
|
483
503
|
config.add_strategy :my_custom_strategy, Strategies::MyCustomStrategy
|
484
504
|
end
|
@@ -516,7 +536,7 @@ The method or the proc can return a modified version of args without the transie
|
|
516
536
|
class UniqueJobWithFilterMethod
|
517
537
|
include Sidekiq::Worker
|
518
538
|
sidekiq_options lock: :until_and_while_executing,
|
519
|
-
|
539
|
+
lock_args_method: :lock_args # this is default and will be used if such a method is defined
|
520
540
|
|
521
541
|
def self.lock_args(args)
|
522
542
|
[ args[0], args[2][:type] ]
|
@@ -529,7 +549,7 @@ end
|
|
529
549
|
class UniqueJobWithFilterProc
|
530
550
|
include Sidekiq::Worker
|
531
551
|
sidekiq_options lock: :until_executed,
|
532
|
-
|
552
|
+
lock_args_method: ->(args) { [ args.first ] }
|
533
553
|
|
534
554
|
...
|
535
555
|
|
@@ -541,7 +561,7 @@ It is possible to ensure different types of unique args based on context. I can'
|
|
541
561
|
```ruby
|
542
562
|
class UniqueJobWithFilterMethod
|
543
563
|
include Sidekiq::Worker
|
544
|
-
sidekiq_options lock: :until_and_while_executing,
|
564
|
+
sidekiq_options lock: :until_and_while_executing, lock_args_method: :lock_args
|
545
565
|
|
546
566
|
def self.lock_args(args)
|
547
567
|
if Sidekiq::ProcessSet.new.size > 1
|
@@ -578,6 +598,7 @@ class UniqueJobWithFilterMethod
|
|
578
598
|
end
|
579
599
|
...
|
580
600
|
end.
|
601
|
+
```
|
581
602
|
|
582
603
|
### Logging
|
583
604
|
|
@@ -601,8 +622,8 @@ For sidekiq versions before 5.1 a `sidekiq_retries_exhausted` block is required
|
|
601
622
|
```ruby
|
602
623
|
class MyWorker
|
603
624
|
sidekiq_retries_exhausted do |msg, _ex|
|
604
|
-
digest = msg['
|
605
|
-
SidekiqUniqueJobs::Digests.delete_by_digest(digest) if digest
|
625
|
+
digest = msg['lock_digest']
|
626
|
+
SidekiqUniqueJobs::Digests.new.delete_by_digest(digest) if digest
|
606
627
|
end
|
607
628
|
end
|
608
629
|
```
|
@@ -610,11 +631,10 @@ end
|
|
610
631
|
Starting in v5.1, Sidekiq can also fire a global callback when a job dies:
|
611
632
|
|
612
633
|
```ruby
|
613
|
-
# this goes in your initializer
|
614
634
|
Sidekiq.configure_server do |config|
|
615
635
|
config.death_handlers << ->(job, _ex) do
|
616
|
-
digest = job['
|
617
|
-
SidekiqUniqueJobs::Digests.delete_by_digest(digest) if digest
|
636
|
+
digest = job['lock_digest']
|
637
|
+
SidekiqUniqueJobs::Digests.new.delete_by_digest(digest) if digest
|
618
638
|
end
|
619
639
|
end
|
620
640
|
```
|
@@ -648,7 +668,7 @@ There are several ways of removing keys that are stuck. The prefered way is by u
|
|
648
668
|
To use the web extension you need to require it in your routes.
|
649
669
|
|
650
670
|
```ruby
|
651
|
-
#
|
671
|
+
#app/config/routes.rb
|
652
672
|
require 'sidekiq_unique_jobs/web'
|
653
673
|
mount Sidekiq::Web, at: '/sidekiq'
|
654
674
|
```
|
@@ -679,15 +699,15 @@ Since v7 it is possible to perform some simple validation against your workers s
|
|
679
699
|
Let's take a _bad_ worker:
|
680
700
|
|
681
701
|
```ruby
|
682
|
-
#
|
702
|
+
#app/workers/bad_worker.rb
|
683
703
|
class BadWorker
|
684
704
|
sidekiq_options lock: :while_executing, on_conflict: :replace
|
685
705
|
end
|
686
706
|
|
687
|
-
#
|
707
|
+
#spec/workers/bad_worker_spec.rb
|
688
708
|
|
689
709
|
require "sidekiq_unique_jobs/testing"
|
690
|
-
#
|
710
|
+
#OR
|
691
711
|
require "sidekiq_unique_jobs/rspec/matchers"
|
692
712
|
|
693
713
|
RSpec.describe BadWorker do
|