sidekiq-unique-jobs 7.0.1 → 7.0.2
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 +34 -34
- data/README.md +22 -8
- data/lib/sidekiq_unique_jobs/batch_delete.rb +1 -1
- data/lib/sidekiq_unique_jobs/json.rb +7 -1
- data/lib/sidekiq_unique_jobs/lock.rb +31 -1
- data/lib/sidekiq_unique_jobs/lua/lock.lua +9 -9
- data/lib/sidekiq_unique_jobs/lua/shared/_find_digest_in_process_set.lua +1 -1
- data/lib/sidekiq_unique_jobs/orphans/ruby_reaper.rb +9 -7
- data/lib/sidekiq_unique_jobs/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b34494d8b6a8a456d1bae7f88d19d0effa3772a14ec6e835fdb1818684c6429c
|
4
|
+
data.tar.gz: 05abaa45fb5ae3ff65f0e921da86c9b7df8fea97ba11fbe1f2314f239ccd99e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f715b5e6afd217ab5339a295bb43c234ef50e723b683021da9f7136e91d6cc6cf8d966ea50ea8acbe8b700c2f3e6d4503caab89cd39c570d5a906e332d11c873
|
7
|
+
data.tar.gz: d2dd8182d2e59029a6c440f2a9260a2ea1b8c59be03218c4df616b17e27610fe44f5dae77c492fd156510cd9fa89cd5fcd5212a69f9050069ce6579561f95381
|
data/CHANGELOG.md
CHANGED
@@ -1,38 +1,46 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
## [
|
3
|
+
## [v7.0.1](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.1) (2021-01-22)
|
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...v7.0.1)
|
6
6
|
|
7
|
+
**Implemented enhancements:**
|
8
|
+
|
9
|
+
- Any way to manually clear/reset the changelog history? [\#568](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/568)
|
10
|
+
- Present the entire changelog in its own view [\#569](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/569) ([mhenrixon](https://github.com/mhenrixon))
|
11
|
+
|
12
|
+
**Fixed bugs:**
|
13
|
+
|
14
|
+
- Fix configuration [\#570](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/570) ([mhenrixon](https://github.com/mhenrixon))
|
15
|
+
|
16
|
+
**Closed issues:**
|
7
17
|
|
18
|
+
- undefined method 'delete\_by\_digest' for SidekiqUniqueJobs::Digests:Class [\#567](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/567)
|
19
|
+
- Rejected jobs are still displayed as 'Queued' with gem 'sidekiq-status' on /sidekiq/statuses [\#564](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/564)
|
8
20
|
|
9
21
|
## [v7.0.0](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0) (2021-01-20)
|
10
22
|
|
11
|
-
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/
|
23
|
+
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta29...v7.0.0)
|
12
24
|
|
13
25
|
**Implemented enhancements:**
|
14
26
|
|
15
27
|
- Give user full control over adding middleware [\#566](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/566) ([mhenrixon](https://github.com/mhenrixon))
|
28
|
+
- Fix coverage reporting and add coverage [\#565](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/565) ([mhenrixon](https://github.com/mhenrixon))
|
16
29
|
|
17
30
|
**Fixed bugs:**
|
18
31
|
|
19
32
|
- Race condition in ruby reaper [\#559](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/559)
|
20
33
|
- Fix until and while executed and improve documentation [\#397](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/397)
|
21
|
-
- Fix
|
34
|
+
- Fix race condition to avoid reaping active jobs [\#563](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/563) ([mhenrixon](https://github.com/mhenrixon))
|
22
35
|
|
23
36
|
**Closed issues:**
|
24
37
|
|
25
|
-
- Rejected jobs are still displayed as 'Queued' with gem 'sidekiq-status' on /sidekiq/statuses [\#564](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/564)
|
26
38
|
- Is it possible to have a :until\_executed lock with an expiration time? [\#524](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/524)
|
27
39
|
|
28
40
|
## [v7.0.0.beta29](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta29) (2021-01-16)
|
29
41
|
|
30
42
|
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta28...v7.0.0.beta29)
|
31
43
|
|
32
|
-
**Implemented enhancements:**
|
33
|
-
|
34
|
-
- Fix coverage reporting and add coverage [\#565](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/565) ([mhenrixon](https://github.com/mhenrixon))
|
35
|
-
|
36
44
|
**Fixed bugs:**
|
37
45
|
|
38
46
|
- Ruby Reaper active check incorrect [\#557](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/557)
|
@@ -50,7 +58,6 @@
|
|
50
58
|
|
51
59
|
- 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)
|
52
60
|
- incorrect `:while\_executing` behavior [\#432](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/432)
|
53
|
-
- Fix race condition to avoid reaping active jobs [\#563](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/563) ([mhenrixon](https://github.com/mhenrixon))
|
54
61
|
- Fix active check for the worker hash [\#558](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/558) ([mhenrixon](https://github.com/mhenrixon))
|
55
62
|
- Prefer lock\_prefix not unique\_prefix [\#554](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/554) ([mhenrixon](https://github.com/mhenrixon))
|
56
63
|
- Fix issue 432 [\#552](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/552) ([mhenrixon](https://github.com/mhenrixon))
|
@@ -66,6 +73,7 @@
|
|
66
73
|
**Fixed bugs:**
|
67
74
|
|
68
75
|
- Rename lock\_args to lock\_args\_method [\#551](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/551) ([mhenrixon](https://github.com/mhenrixon))
|
76
|
+
- Fix RubyReaper active? [\#538](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/538) ([tanner-rutgers](https://github.com/tanner-rutgers))
|
69
77
|
|
70
78
|
**Closed issues:**
|
71
79
|
|
@@ -105,7 +113,6 @@
|
|
105
113
|
**Fixed bugs:**
|
106
114
|
|
107
115
|
- Ruby reaper not working, active jobs queried incorrectly [\#537](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/537)
|
108
|
-
- Fix RubyReaper active? [\#538](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/538) ([tanner-rutgers](https://github.com/tanner-rutgers))
|
109
116
|
|
110
117
|
**Closed issues:**
|
111
118
|
|
@@ -165,7 +172,6 @@
|
|
165
172
|
**Fixed bugs:**
|
166
173
|
|
167
174
|
- Prevent indefinitely looping entries [\#516](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/516) ([mhenrixon](https://github.com/mhenrixon))
|
168
|
-
- Don't bypass lock\_args if arguments are empty [\#511](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/511) ([nhippenmeyer](https://github.com/nhippenmeyer))
|
169
175
|
|
170
176
|
**Closed issues:**
|
171
177
|
|
@@ -198,6 +204,7 @@
|
|
198
204
|
**Fixed bugs:**
|
199
205
|
|
200
206
|
- Stringify on\_conflict hash in Job prepare method [\#507](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/507) ([jasonbekolay](https://github.com/jasonbekolay))
|
207
|
+
- Fix access to both server and client conflict [\#503](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/503) ([mhenrixon](https://github.com/mhenrixon))
|
201
208
|
|
202
209
|
## [v7.0.0.beta17](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta17) (2020-05-20)
|
203
210
|
|
@@ -207,10 +214,6 @@
|
|
207
214
|
|
208
215
|
- Try GitHub actions [\#505](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/505) ([mhenrixon](https://github.com/mhenrixon))
|
209
216
|
|
210
|
-
**Fixed bugs:**
|
211
|
-
|
212
|
-
- 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))
|
213
|
-
|
214
217
|
## [v7.0.0.beta16](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta16) (2020-05-19)
|
215
218
|
|
216
219
|
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.22...v7.0.0.beta16)
|
@@ -218,7 +221,6 @@
|
|
218
221
|
**Fixed bugs:**
|
219
222
|
|
220
223
|
- Deprecate configuration options with `default\_` [\#504](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/504) ([mhenrixon](https://github.com/mhenrixon))
|
221
|
-
- Fix access to both server and client conflict [\#503](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/503) ([mhenrixon](https://github.com/mhenrixon))
|
222
224
|
|
223
225
|
**Closed issues:**
|
224
226
|
|
@@ -230,6 +232,7 @@
|
|
230
232
|
|
231
233
|
**Fixed bugs:**
|
232
234
|
|
235
|
+
- 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))
|
233
236
|
- \[LockType\] Allow overwriting default lock type at item level [\#497](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/497) ([EmmN](https://github.com/EmmN))
|
234
237
|
|
235
238
|
## [v7.0.0.beta15](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta15) (2020-04-10)
|
@@ -247,6 +250,7 @@
|
|
247
250
|
- Brpoplpush::RedisScript::LuaError: WRONGTYPE Operation against a key holding the wrong kind of value [\#491](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/491)
|
248
251
|
- Lua script bug [\#489](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/489)
|
249
252
|
- Reaper will delete locks for running jobs [\#488](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/488)
|
253
|
+
- Fix access to hash members [\#496](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/496) ([mhenrixon](https://github.com/mhenrixon))
|
250
254
|
- Fix cursor assignment [\#494](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/494) ([mhenrixon](https://github.com/mhenrixon))
|
251
255
|
- Prevent reaping of active jobs [\#493](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/493) ([mhenrixon](https://github.com/mhenrixon))
|
252
256
|
|
@@ -264,7 +268,6 @@
|
|
264
268
|
|
265
269
|
**Fixed bugs:**
|
266
270
|
|
267
|
-
- Fix access to hash members [\#496](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/496) ([mhenrixon](https://github.com/mhenrixon))
|
268
271
|
- Use thread-safe digest creation mechanism [\#484](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/484) ([mhenrixon](https://github.com/mhenrixon))
|
269
272
|
|
270
273
|
## [v7.0.0.beta13](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta13) (2020-03-26)
|
@@ -283,6 +286,7 @@
|
|
283
286
|
|
284
287
|
- until\_expired is not setting TTL [\#468](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/468)
|
285
288
|
- Fix bug where expiration wasn't set until unlock [\#481](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/481) ([mhenrixon](https://github.com/mhenrixon))
|
289
|
+
- Fix access to lock [\#476](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/476) ([mhenrixon](https://github.com/mhenrixon))
|
286
290
|
|
287
291
|
## [v6.0.20](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.20) (2020-03-22)
|
288
292
|
|
@@ -336,7 +340,6 @@
|
|
336
340
|
|
337
341
|
**Fixed bugs:**
|
338
342
|
|
339
|
-
- Fix access to lock [\#476](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/476) ([mhenrixon](https://github.com/mhenrixon))
|
340
343
|
- Backport v7 fix for conflicts [\#461](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/461) ([mhenrixon](https://github.com/mhenrixon))
|
341
344
|
|
342
345
|
## [v7.0.0.beta9](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta9) (2019-12-04)
|
@@ -346,7 +349,6 @@
|
|
346
349
|
**Implemented enhancements:**
|
347
350
|
|
348
351
|
- Keys without TTL [\#417](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/417)
|
349
|
-
- Various changes to test and verify reliability [\#463](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/463) ([mhenrixon](https://github.com/mhenrixon))
|
350
352
|
|
351
353
|
**Closed issues:**
|
352
354
|
|
@@ -359,6 +361,7 @@
|
|
359
361
|
**Implemented enhancements:**
|
360
362
|
|
361
363
|
- Allow worker to configure client and server strategies separately [\#402](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/402)
|
364
|
+
- Various changes to test and verify reliability [\#463](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/463) ([mhenrixon](https://github.com/mhenrixon))
|
362
365
|
- Separate client and server on\_conflict [\#462](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/462) ([mhenrixon](https://github.com/mhenrixon))
|
363
366
|
|
364
367
|
**Fixed bugs:**
|
@@ -500,7 +503,6 @@
|
|
500
503
|
|
501
504
|
**Fixed bugs:**
|
502
505
|
|
503
|
-
- Include redis directory [\#430](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/430) ([mhenrixon](https://github.com/mhenrixon))
|
504
506
|
- Allow Sidekiq::Context to be used for logging [\#429](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/429) ([mhenrixon](https://github.com/mhenrixon))
|
505
507
|
- Fix sidekiq develop [\#426](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/426) ([mhenrixon](https://github.com/mhenrixon))
|
506
508
|
- Reap as many orphans as advertised [\#403](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/403) ([mhenrixon](https://github.com/mhenrixon))
|
@@ -527,6 +529,7 @@
|
|
527
529
|
|
528
530
|
- Duplicate job was pushed \( v6.0.13 \) [\#414](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/414)
|
529
531
|
- Constant SidekiqUniqueJobs::Web::Digests not found [\#396](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/396)
|
532
|
+
- Include redis directory [\#430](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/430) ([mhenrixon](https://github.com/mhenrixon))
|
530
533
|
- Fix v6 [\#428](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/428) ([mhenrixon](https://github.com/mhenrixon))
|
531
534
|
|
532
535
|
**Closed issues:**
|
@@ -583,6 +586,7 @@
|
|
583
586
|
- Version 6 Ignores Jobs Enqueued in Version 5 [\#345](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/345)
|
584
587
|
- Job will not enqueue even with no existing match [\#342](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/342)
|
585
588
|
- Convert v5 locks when needed [\#375](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/375) ([mhenrixon](https://github.com/mhenrixon))
|
589
|
+
- Always Remove Job ID from uniquejobs Hash [\#347](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/347) ([chadrschroeder](https://github.com/chadrschroeder))
|
586
590
|
|
587
591
|
**Closed issues:**
|
588
592
|
|
@@ -647,7 +651,7 @@
|
|
647
651
|
|
648
652
|
- Version 5: Job ID Hash Entries Not Removed if Unique Key Expires [\#346](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/346)
|
649
653
|
- Move the lpush last [\#354](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/354) ([mhenrixon](https://github.com/mhenrixon))
|
650
|
-
-
|
654
|
+
- Convert expiration time to integer [\#330](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/330) ([dareddov](https://github.com/dareddov))
|
651
655
|
|
652
656
|
**Closed issues:**
|
653
657
|
|
@@ -666,11 +670,6 @@
|
|
666
670
|
|
667
671
|
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.6...v5.0.11)
|
668
672
|
|
669
|
-
**Fixed bugs:**
|
670
|
-
|
671
|
-
- Always Remove Job ID from uniquejobs Hash [\#347](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/347) ([chadrschroeder](https://github.com/chadrschroeder))
|
672
|
-
- Convert expiration time to integer [\#330](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/330) ([dareddov](https://github.com/dareddov))
|
673
|
-
|
674
673
|
**Closed issues:**
|
675
674
|
|
676
675
|
- concurrent-ruby 1.1.1 is causing this gem to break [\#340](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/340)
|
@@ -710,6 +709,10 @@
|
|
710
709
|
|
711
710
|
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.3...v6.0.4)
|
712
711
|
|
712
|
+
**Fixed bugs:**
|
713
|
+
|
714
|
+
- Fix the broken expiration [\#316](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/316) ([mhenrixon](https://github.com/mhenrixon))
|
715
|
+
|
713
716
|
**Closed issues:**
|
714
717
|
|
715
718
|
- Question about until\_timeout with 6.0.0 [\#303](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/303)
|
@@ -757,7 +760,6 @@
|
|
757
760
|
|
758
761
|
- Dead jobs [\#308](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/308) ([mhenrixon](https://github.com/mhenrixon))
|
759
762
|
- Fix require path for sidekiq\_unique\_jobs/web [\#305](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/305) ([soundasleep](https://github.com/soundasleep))
|
760
|
-
- Update README.md [\#300](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/300) ([pirj](https://github.com/pirj))
|
761
763
|
|
762
764
|
## [v6.0.0](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0) (2018-07-27)
|
763
765
|
|
@@ -776,6 +778,7 @@
|
|
776
778
|
**Merged pull requests:**
|
777
779
|
|
778
780
|
- Add more details about testing uniqueness [\#301](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/301) ([mhenrixon](https://github.com/mhenrixon))
|
781
|
+
- Update README.md [\#300](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/300) ([pirj](https://github.com/pirj))
|
779
782
|
|
780
783
|
## [v6.0.0.rc7](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0.rc7) (2018-07-23)
|
781
784
|
|
@@ -820,6 +823,7 @@
|
|
820
823
|
**Fixed bugs:**
|
821
824
|
|
822
825
|
- bundle exec jobs console does not work [\#253](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/253)
|
826
|
+
- Rename command line binary [\#287](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/287) ([mhenrixon](https://github.com/mhenrixon))
|
823
827
|
|
824
828
|
## [v6.0.0.rc4](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0.rc4) (2018-06-30)
|
825
829
|
|
@@ -830,10 +834,6 @@
|
|
830
834
|
- Prepare for v6 [\#286](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/286) ([mhenrixon](https://github.com/mhenrixon))
|
831
835
|
- Only unlock not delete [\#285](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/285) ([mhenrixon](https://github.com/mhenrixon))
|
832
836
|
|
833
|
-
**Fixed bugs:**
|
834
|
-
|
835
|
-
- Rename command line binary [\#287](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/287) ([mhenrixon](https://github.com/mhenrixon))
|
836
|
-
|
837
837
|
## [v6.0.0.rc3](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0.rc3) (2018-06-29)
|
838
838
|
|
839
839
|
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.0.rc2...v6.0.0.rc3)
|
@@ -878,7 +878,6 @@
|
|
878
878
|
|
879
879
|
- Legacy support [\#280](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/280)
|
880
880
|
- Adds legacy support [\#281](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/281) ([mhenrixon](https://github.com/mhenrixon))
|
881
|
-
- Adds guard-reek [\#279](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/279) ([mhenrixon](https://github.com/mhenrixon))
|
882
881
|
- Fix UntilExpired [\#278](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/278) ([mhenrixon](https://github.com/mhenrixon))
|
883
882
|
|
884
883
|
## [v6.0.0.beta2](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0.beta2) (2018-06-25)
|
@@ -896,7 +895,9 @@
|
|
896
895
|
|
897
896
|
**Implemented enhancements:**
|
898
897
|
|
898
|
+
- Adds guard-reek [\#279](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/279) ([mhenrixon](https://github.com/mhenrixon))
|
899
899
|
- Code smells [\#275](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/275) ([mhenrixon](https://github.com/mhenrixon))
|
900
|
+
- Reject while scheduling [\#273](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/273) ([mhenrixon](https://github.com/mhenrixon))
|
900
901
|
- Improve testing [\#272](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/272) ([mhenrixon](https://github.com/mhenrixon))
|
901
902
|
|
902
903
|
## [v6.0.0.beta](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0.beta) (2018-06-17)
|
@@ -905,7 +906,6 @@
|
|
905
906
|
|
906
907
|
**Implemented enhancements:**
|
907
908
|
|
908
|
-
- Reject while scheduling [\#273](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/273) ([mhenrixon](https://github.com/mhenrixon))
|
909
909
|
- Until and while executing [\#271](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/271) ([mhenrixon](https://github.com/mhenrixon))
|
910
910
|
- Solidify master [\#270](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/270) ([mhenrixon](https://github.com/mhenrixon))
|
911
911
|
- Minor adjustments [\#268](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/268) ([mhenrixon](https://github.com/mhenrixon))
|
data/README.md
CHANGED
@@ -100,7 +100,7 @@ Before v7, the middleware was configured automatically. Since some people report
|
|
100
100
|
|
101
101
|
*NOTE* if you want to use the reaper you also need to configure the server middleware.
|
102
102
|
|
103
|
-
[A full
|
103
|
+
[A full example](https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/myapp/config/initializers/sidekiq.rb#L12)
|
104
104
|
|
105
105
|
```ruby
|
106
106
|
Sidekiq.configure_server do |config|
|
@@ -709,7 +709,7 @@ class MyWorker
|
|
709
709
|
end
|
710
710
|
```
|
711
711
|
|
712
|
-
Starting in v5.1, Sidekiq can also fire a global callback when a job dies:
|
712
|
+
Starting in v5.1, Sidekiq can also fire a global callback when a job dies: In version 7, this is handled automatically for you. You don't need to add a death handler, if you configure v7 like in [Add the middleware](#add-the-middleware) you don't have to worry about the below.
|
713
713
|
|
714
714
|
```ruby
|
715
715
|
Sidekiq.configure_server do |config|
|
@@ -765,14 +765,28 @@ The reason for this is that the global id needs to be set before the unique jobs
|
|
765
765
|
It was reported in [#564](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/564) that the order of the middleware needs to be as follows.
|
766
766
|
|
767
767
|
```ruby
|
768
|
-
|
769
|
-
|
770
|
-
|
768
|
+
# Thanks to @ArturT for the correction
|
769
|
+
|
770
|
+
Sidekiq.configure_server do |config|
|
771
|
+
config.client_middleware do |chain|
|
772
|
+
chain.add SidekiqUniqueJobs::Middleware::Client
|
773
|
+
chain.add Sidekiq::Status::ClientMiddleware, expiration: 30.minutes
|
774
|
+
end
|
775
|
+
|
776
|
+
config.server_middleware do |chain|
|
777
|
+
chain.add Sidekiq::Status::ServerMiddleware, expiration: 30.minutes
|
778
|
+
chain.add SidekiqUniqueJobs::Middleware::Server
|
779
|
+
end
|
780
|
+
|
781
|
+
SidekiqUniqueJobs::Server.configure(config)
|
771
782
|
end
|
772
783
|
|
773
|
-
|
774
|
-
|
775
|
-
|
784
|
+
|
785
|
+
Sidekiq.configure_client do |config|
|
786
|
+
config.client_middleware do |chain|
|
787
|
+
chain.add SidekiqUniqueJobs::Middleware::Client
|
788
|
+
chain.add Sidekiq::Status::ClientMiddleware, expiration: 30.minutes
|
789
|
+
end
|
776
790
|
end
|
777
791
|
```
|
778
792
|
|
@@ -15,11 +15,17 @@ module SidekiqUniqueJobs
|
|
15
15
|
# @return [Object]
|
16
16
|
#
|
17
17
|
def load_json(string)
|
18
|
-
return
|
18
|
+
return if string.nil? || string.empty?
|
19
19
|
|
20
20
|
::JSON.parse(string)
|
21
21
|
end
|
22
22
|
|
23
|
+
def safe_load_json(string)
|
24
|
+
return string if string.is_a?(Hash)
|
25
|
+
|
26
|
+
load_json(string)
|
27
|
+
end
|
28
|
+
|
23
29
|
#
|
24
30
|
# Dumps an object into a JSON string
|
25
31
|
#
|
@@ -53,7 +53,7 @@ module SidekiqUniqueJobs
|
|
53
53
|
#
|
54
54
|
# Locks a job_id
|
55
55
|
#
|
56
|
-
# @note intended only for testing
|
56
|
+
# @note intended only for testing purposes
|
57
57
|
#
|
58
58
|
# @param [String] job_id a sidekiq JID
|
59
59
|
# @param [Hash] lock_info information about the lock
|
@@ -73,6 +73,36 @@ module SidekiqUniqueJobs
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
+
#
|
77
|
+
# Create the :QUEUED key
|
78
|
+
#
|
79
|
+
# @note intended only for testing purposes
|
80
|
+
#
|
81
|
+
# @param [String] job_id a sidekiq JID
|
82
|
+
#
|
83
|
+
# @return [void]
|
84
|
+
#
|
85
|
+
def queue(job_id)
|
86
|
+
redis do |conn|
|
87
|
+
conn.lpush(key.queued, job_id)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
#
|
92
|
+
# Create the :PRIMED key
|
93
|
+
#
|
94
|
+
# @note intended only for testing purposes
|
95
|
+
#
|
96
|
+
# @param [String] job_id a sidekiq JID
|
97
|
+
#
|
98
|
+
# @return [void]
|
99
|
+
#
|
100
|
+
def prime(job_id)
|
101
|
+
redis do |conn|
|
102
|
+
conn.lpush(key.primed, job_id)
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
76
106
|
#
|
77
107
|
# Unlock a specific job_id
|
78
108
|
#
|
@@ -74,19 +74,19 @@ if pttl and pttl > 0 then
|
|
74
74
|
log_debug("PEXPIRE", digest, pttl)
|
75
75
|
redis.call("PEXPIRE", digest, pttl)
|
76
76
|
|
77
|
-
log_debug("PEXPIRE", queued, pttl)
|
78
|
-
redis.call("PEXPIRE", queued, pttl)
|
79
|
-
|
80
|
-
log_debug("PEXPIRE", primed, pttl)
|
81
|
-
redis.call("PEXPIRE", primed, pttl)
|
82
|
-
|
83
77
|
log_debug("PEXPIRE", locked, pttl)
|
84
78
|
redis.call("PEXPIRE", locked, pttl)
|
85
|
-
|
86
|
-
log_debug("PEXPIRE", info, pttl)
|
87
|
-
redis.call("PEXPIRE", info, pttl)
|
88
79
|
end
|
89
80
|
|
81
|
+
log_debug("PEXPIRE", queued, 1000)
|
82
|
+
redis.call("PEXPIRE", queued, 1000)
|
83
|
+
|
84
|
+
log_debug("PEXPIRE", primed, 1000)
|
85
|
+
redis.call("PEXPIRE", primed, 1000)
|
86
|
+
|
87
|
+
log_debug("PEXPIRE", info, 1000)
|
88
|
+
redis.call("PEXPIRE", info, 1000)
|
89
|
+
|
90
90
|
log("Locked")
|
91
91
|
log_debug("END lock digest:", digest, "job_id:", job_id)
|
92
92
|
return job_id
|
@@ -52,11 +52,11 @@ module SidekiqUniqueJobs
|
|
52
52
|
# @return [Array<String>] an array of orphaned digests
|
53
53
|
#
|
54
54
|
def orphans
|
55
|
-
conn.zrevrange(digests.key, 0, -1).each_with_object([]) do |digest,
|
55
|
+
conn.zrevrange(digests.key, 0, -1).each_with_object([]) do |digest, memo|
|
56
56
|
next if belongs_to_job?(digest)
|
57
57
|
|
58
|
-
|
59
|
-
break if
|
58
|
+
memo << digest
|
59
|
+
break if memo.size >= reaper_count
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
@@ -117,7 +117,7 @@ module SidekiqUniqueJobs
|
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
120
|
-
def active?(digest) # rubocop:disable Metrics/MethodLength, Metrics/CyclomaticComplexity
|
120
|
+
def active?(digest) # rubocop:disable Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
121
121
|
Sidekiq.redis do |conn|
|
122
122
|
procs = conn.sscan_each("processes").to_a
|
123
123
|
return false if procs.empty?
|
@@ -132,10 +132,12 @@ module SidekiqUniqueJobs
|
|
132
132
|
next unless workers.any?
|
133
133
|
|
134
134
|
workers.each_pair do |_tid, job|
|
135
|
-
item =
|
135
|
+
next unless (item = safe_load_json(job))
|
136
136
|
|
137
|
-
|
138
|
-
|
137
|
+
payload = safe_load_json(item[PAYLOAD])
|
138
|
+
|
139
|
+
return true if payload[LOCK_DIGEST] == digest
|
140
|
+
return true if considered_active?(payload[CREATED_AT])
|
139
141
|
end
|
140
142
|
end
|
141
143
|
|
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.
|
4
|
+
version: 7.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikael Henriksson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: brpoplpush-redis_script
|
@@ -256,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
256
256
|
- !ruby/object:Gem::Version
|
257
257
|
version: '0'
|
258
258
|
requirements: []
|
259
|
-
rubygems_version: 3.2.
|
259
|
+
rubygems_version: 3.2.6
|
260
260
|
signing_key:
|
261
261
|
specification_version: 4
|
262
262
|
summary: Sidekiq middleware that prevents duplicates jobs
|