sidekiq-unique-jobs 7.0.5 → 7.0.10

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: 35af721bd8342dc7bbfcc204b12869ee3e78bb0c644db358c479d6ab2de5bba3
4
- data.tar.gz: ca936a331cd5d2c591de1d74c000f4e62be908076d188dc7d2e8995965c69b5d
3
+ metadata.gz: 6ca04978df51e42d3caff1ba4f1d76808063490e086ac127a0adca0a5f5c0582
4
+ data.tar.gz: 1a9eb7db31ff36c5e31a9574ea5c31691d4681026591e1357ef87a532d378eb8
5
5
  SHA512:
6
- metadata.gz: 9dcc1eec857d0d66d5eee722a85b4312fd8736c901bf03d5df4529e2c661c58ee493e51910966627c00534268da6a5e5e48b88bc767fdb44b2109ac6be33173a
7
- data.tar.gz: 5a01f57c898b29354b83729b120e9488846f364e69fd022ce7b29a6c23b35ad789046a1ab8c41c38c221a273cc15eff3e41cae75589468ab52b62207eb7de241
6
+ metadata.gz: 105ce9d2db36e66d2fa8bca1f17ccecd9e218ff72d739b915b8afef964d1434ef45d3aaf69ca527b05339f20d6dab8e1565bb9bbf5f55abc33a30f304dd3b0c0
7
+ data.tar.gz: a6fbf97428a828e66f9b30eb7c24ee82c2813d4fdac38eb192e931e1d4c75b1e53d84e9892812720ce4669f96f682c193b873bd30e20398c92e7d6b32eff858a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,71 @@
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.8...HEAD)
6
+
7
+ **Fixed bugs:**
8
+
9
+ - lock\_info set to true but no lock info showing up in web ui [\#589](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/589)
10
+ - Fix recording lock\_info [\#599](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/599) ([mhenrixon](https://github.com/mhenrixon))
11
+
12
+ ## [v7.0.8](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.8) (2021-04-14)
13
+
14
+ [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.7...v7.0.8)
15
+
16
+ **Implemented enhancements:**
17
+
18
+ - Lock performance [\#595](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/595) ([mhenrixon](https://github.com/mhenrixon))
19
+ - Allow and test ruby 3.0 [\#587](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/587) ([mhenrixon](https://github.com/mhenrixon))
20
+
21
+ **Closed issues:**
22
+
23
+ - Question: where do orphaned locks come from? [\#592](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/592)
24
+ - upgrade\_v6\_lock : ERR wrong number of arguments for 'hmset' command [\#591](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/591)
25
+
26
+ **Merged pull requests:**
27
+
28
+ - Fix uniqueness examples url in documentation [\#596](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/596) ([sampatbadhe](https://github.com/sampatbadhe))
29
+
30
+ ## [v7.0.7](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.7) (2021-03-19)
31
+
32
+ [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.6...v7.0.7)
33
+
34
+ **Fixed bugs:**
35
+
36
+ - Web filter param not working in pagination [\#584](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/584) ([mhenrixon](https://github.com/mhenrixon))
37
+
38
+ ## [v7.0.6](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.6) (2021-03-19)
39
+
40
+ [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.5...v7.0.6)
41
+
42
+ **Fixed bugs:**
43
+
44
+ - Deprecation warning for redis behaviour change in 5.0 [\#579](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/579)
45
+ - Consider a match only when both values present [\#586](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/586) ([mhenrixon](https://github.com/mhenrixon))
46
+
47
+ **Closed issues:**
48
+
49
+ - Reaper: undefined method `delete\_suffix' for nil:NilClass [\#585](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/585)
50
+
51
+ ## [v7.0.5](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.5) (2021-03-18)
52
+
53
+ [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.4...v7.0.5)
54
+
55
+ **Implemented enhancements:**
56
+
57
+ - Improve compatibility with redis-namespace [\#581](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/581) ([Wolfer](https://github.com/Wolfer))
58
+
59
+ **Fixed bugs:**
60
+
61
+ - RubyReaper treats runtime lock as orphan and delete it [\#580](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/580)
62
+ - Prefer conn.exists? when possible [\#583](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/583) ([mhenrixon](https://github.com/mhenrixon))
63
+ - Don't reap :RUN keys when active [\#582](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/582) ([mhenrixon](https://github.com/mhenrixon))
64
+
65
+ **Closed issues:**
66
+
67
+ - redis-namespace asks to use admistrative commands directly [\#578](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/578)
68
+
3
69
  ## [v7.0.4](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.4) (2021-02-17)
4
70
 
5
71
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.3...v7.0.4)
@@ -37,6 +103,7 @@
37
103
  - Jobs executing and immediately returning [\#418](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/418)
38
104
  - until\_and\_while\_executing + sidekiq retry mechanism [\#395](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/395)
39
105
  - Failed jobs waiting to be retried are not considered when fetching uniqueness [\#394](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/394)
106
+ - Fix that :PRIMED keys are seemingly not removed [\#574](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/574) ([mhenrixon](https://github.com/mhenrixon))
40
107
 
41
108
  **Closed issues:**
42
109
 
@@ -95,7 +162,6 @@
95
162
  **Fixed bugs:**
96
163
 
97
164
  - Ruby Reaper active check incorrect [\#557](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/557)
98
- - Fix that :PRIMED keys are seemingly not removed [\#574](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/574) ([mhenrixon](https://github.com/mhenrixon))
99
165
  - Routes with authentication should work with web [\#562](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/562) ([mhenrixon](https://github.com/mhenrixon))
100
166
 
101
167
  **Closed issues:**
@@ -109,7 +175,7 @@
109
175
  **Fixed bugs:**
110
176
 
111
177
  - 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)
112
- - incorrect `:while\_executing` behavior [\#432](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/432)
178
+ - incorrect `:while_executing` behavior [\#432](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/432)
113
179
  - Fix active check for the worker hash [\#558](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/558) ([mhenrixon](https://github.com/mhenrixon))
114
180
  - Prefer lock\_prefix not unique\_prefix [\#554](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/554) ([mhenrixon](https://github.com/mhenrixon))
115
181
  - Fix issue 432 [\#552](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/552) ([mhenrixon](https://github.com/mhenrixon))
@@ -128,7 +194,7 @@
128
194
 
129
195
  **Closed issues:**
130
196
 
131
- - Documentation incorrect for `delete\_by\_digest` [\#547](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/547)
197
+ - Documentation incorrect for `delete_by_digest` [\#547](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/547)
132
198
  - Locked jobs after kill -9 with while\_executing lock [\#546](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/546)
133
199
 
134
200
  ## [v7.0.0.beta26](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta26) (2020-10-28)
@@ -148,11 +214,6 @@
148
214
 
149
215
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta25...v6.0.25)
150
216
 
151
- **Implemented enhancements:**
152
-
153
- - Support apartment [\#541](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/541) ([mhenrixon](https://github.com/mhenrixon))
154
- - Support both instance method and class method [\#528](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/528) ([mhenrixon](https://github.com/mhenrixon))
155
-
156
217
  ## [v7.0.0.beta25](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta25) (2020-10-26)
157
218
 
158
219
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta24...v7.0.0.beta25)
@@ -170,6 +231,10 @@
170
231
 
171
232
  - ConnectionPool::TimeoutError and :until\_executed [\#535](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/535)
172
233
 
234
+ **Merged pull requests:**
235
+
236
+ - Support apartment [\#540](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/540) ([mhenrixon](https://github.com/mhenrixon))
237
+
173
238
  ## [v7.0.0.beta24](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta24) (2020-09-27)
174
239
 
175
240
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta23...v7.0.0.beta24)
@@ -197,7 +262,6 @@
197
262
  **Fixed bugs:**
198
263
 
199
264
  - Ruby reaper incorrectly checks active jobs — removes every active lock as result [\#517](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/517)
200
- - Backport \#465 to 6.x series [\#520](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/520) ([replaid](https://github.com/replaid))
201
265
 
202
266
  ## [v7.0.0.beta22](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta22) (2020-06-12)
203
267
 
@@ -271,21 +335,17 @@
271
335
 
272
336
  **Fixed bugs:**
273
337
 
274
- - Deprecate configuration options with `default\_` [\#504](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/504) ([mhenrixon](https://github.com/mhenrixon))
338
+ - Deprecate configuration options with `default_` [\#504](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/504) ([mhenrixon](https://github.com/mhenrixon))
275
339
  - Fix access to both server and client conflict [\#503](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/503) ([mhenrixon](https://github.com/mhenrixon))
276
340
 
277
341
  **Closed issues:**
278
342
 
279
- - V7 Beta 15 `on\_conflict:` with Hash does not work on server [\#499](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/499)
343
+ - V7 Beta 15 `on_conflict:` with Hash does not work on server [\#499](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/499)
280
344
 
281
345
  ## [v6.0.22](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.22) (2020-04-13)
282
346
 
283
347
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta15...v6.0.22)
284
348
 
285
- **Fixed bugs:**
286
-
287
- - \[LockType\] Allow overwriting default lock type at item level [\#497](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/497) ([EmmN](https://github.com/EmmN))
288
-
289
349
  ## [v7.0.0.beta15](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta15) (2020-04-10)
290
350
 
291
351
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta14...v7.0.0.beta15)
@@ -297,7 +357,7 @@
297
357
 
298
358
  **Fixed bugs:**
299
359
 
300
- - V7 - `on\_conflict:` no longer accepts a Hash [\#495](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/495)
360
+ - V7 - `on_conflict:` no longer accepts a Hash [\#495](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/495)
301
361
  - Brpoplpush::RedisScript::LuaError: WRONGTYPE Operation against a key holding the wrong kind of value [\#491](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/491)
302
362
  - Lua script bug [\#489](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/489)
303
363
  - Reaper will delete locks for running jobs [\#488](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/488)
@@ -317,14 +377,14 @@
317
377
 
318
378
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta13...v6.0.21)
319
379
 
320
- **Fixed bugs:**
321
-
322
- - Use thread-safe digest creation mechanism [\#484](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/484) ([mhenrixon](https://github.com/mhenrixon))
323
-
324
380
  ## [v7.0.0.beta13](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta13) (2020-03-26)
325
381
 
326
382
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta12...v7.0.0.beta13)
327
383
 
384
+ **Fixed bugs:**
385
+
386
+ - Remove digest deletion for concurrent locks [\#482](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/482) ([mhenrixon](https://github.com/mhenrixon))
387
+
328
388
  ## [v7.0.0.beta12](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta12) (2020-03-25)
329
389
 
330
390
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.20...v7.0.0.beta12)
@@ -341,17 +401,12 @@
341
401
  **Fixed bugs:**
342
402
 
343
403
  - Deletion of digest doesn't work from admin UI [\#438](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/438)
344
- - Remove digest deletion for concurrent locks [\#482](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/482) ([mhenrixon](https://github.com/mhenrixon))
345
404
 
346
405
  **Closed issues:**
347
406
 
348
407
  - Please keep some recent versions on rubygems.org [\#478](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/478)
349
408
  - validate\_worker! throws error [\#466](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/466)
350
409
 
351
- **Merged pull requests:**
352
-
353
- - Allow v7 configuration to work [\#479](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/479) ([mhenrixon](https://github.com/mhenrixon))
354
-
355
410
  ## [v7.0.0.beta11](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta11) (2020-03-21)
356
411
 
357
412
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta10...v7.0.0.beta11)
@@ -370,14 +425,11 @@
370
425
  - Split calculator into two separate [\#474](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/474) ([mhenrixon](https://github.com/mhenrixon))
371
426
  - Prepare for improving tests [\#473](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/473) ([mhenrixon](https://github.com/mhenrixon))
372
427
  - Update gemspec: thor [\#465](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/465) ([masawo](https://github.com/masawo))
373
- - Various changes to test and verify reliability [\#463](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/463) ([mhenrixon](https://github.com/mhenrixon))
374
- - Separate client and server on\_conflict [\#462](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/462) ([mhenrixon](https://github.com/mhenrixon))
375
428
 
376
429
  **Fixed bugs:**
377
430
 
378
431
  - With v6.0.18, Sidekiq doesn't run at all [\#471](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/471)
379
432
  - Fix errors\_as\_string on lock\_config.rb [\#469](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/469) ([donaldpiret](https://github.com/donaldpiret))
380
- - Pass redis\_version into scripts [\#431](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/431) ([mhenrixon](https://github.com/mhenrixon))
381
433
 
382
434
  **Merged pull requests:**
383
435
 
@@ -388,11 +440,6 @@
388
440
 
389
441
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta9...v6.0.19)
390
442
 
391
- **Fixed bugs:**
392
-
393
- - Fix access to lock [\#476](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/476) ([mhenrixon](https://github.com/mhenrixon))
394
- - Backport v7 fix for conflicts [\#461](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/461) ([mhenrixon](https://github.com/mhenrixon))
395
-
396
443
  ## [v7.0.0.beta9](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta9) (2019-12-04)
397
444
 
398
445
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta8...v7.0.0.beta9)
@@ -400,10 +447,11 @@
400
447
  **Implemented enhancements:**
401
448
 
402
449
  - Keys without TTL [\#417](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/417)
450
+ - Various changes to test and verify reliability [\#463](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/463) ([mhenrixon](https://github.com/mhenrixon))
403
451
 
404
452
  **Closed issues:**
405
453
 
406
- - until\_and\_while\_executing with sidekiq pro `reliable\_scheduler!` [\#411](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/411)
454
+ - until\_and\_while\_executing with sidekiq pro `reliable_scheduler!` [\#411](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/411)
407
455
 
408
456
  ## [v7.0.0.beta8](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta8) (2019-11-28)
409
457
 
@@ -412,10 +460,11 @@
412
460
  **Implemented enhancements:**
413
461
 
414
462
  - Allow worker to configure client and server strategies separately [\#402](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/402)
463
+ - Separate client and server on\_conflict [\#462](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/462) ([mhenrixon](https://github.com/mhenrixon))
415
464
 
416
465
  **Fixed bugs:**
417
466
 
418
- - `while\_executing` has problems at low concurrency [\#384](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/384)
467
+ - `while_executing` has problems at low concurrency [\#384](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/384)
419
468
  - lock: :until\_and\_while\_executing not working for scheduled jobs [\#334](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/334)
420
469
 
421
470
  **Closed issues:**
@@ -443,6 +492,7 @@
443
492
  **Merged pull requests:**
444
493
 
445
494
  - Fix that Sidekiq now sends instance of worker [\#459](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/459) ([mhenrixon](https://github.com/mhenrixon))
495
+ - Fix typo in readme [\#456](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/456) ([sheerun](https://github.com/sheerun))
446
496
 
447
497
  ## [v6.0.18](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.18) (2019-11-28)
448
498
 
@@ -451,7 +501,6 @@
451
501
  **Fixed bugs:**
452
502
 
453
503
  - Jobs not pushed when using sidekiq-status [\#412](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/412)
454
- - Fix sidekiq options [\#458](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/458) ([mhenrixon](https://github.com/mhenrixon))
455
504
 
456
505
  **Closed issues:**
457
506
 
@@ -465,6 +514,7 @@
465
514
 
466
515
  - Bump rails [\#450](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/450) ([mhenrixon](https://github.com/mhenrixon))
467
516
  - Rename myapp [\#449](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/449) ([mhenrixon](https://github.com/mhenrixon))
517
+ - Just to keep track of this [\#445](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/445) ([mhenrixon](https://github.com/mhenrixon))
468
518
 
469
519
  **Fixed bugs:**
470
520
 
@@ -480,22 +530,10 @@
480
530
 
481
531
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.16...v6.0.17)
482
532
 
483
- **Fixed bugs:**
484
-
485
- - Allow redis namespace to work with deletion [\#451](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/451) ([mhenrixon](https://github.com/mhenrixon))
486
-
487
533
  ## [v6.0.16](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.16) (2019-11-25)
488
534
 
489
535
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta4...v6.0.16)
490
536
 
491
- **Fixed bugs:**
492
-
493
- - Ensure runtime locks are removed [\#447](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/447) ([mhenrixon](https://github.com/mhenrixon))
494
-
495
- **Merged pull requests:**
496
-
497
- - Fix typo in readme [\#456](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/456) ([sheerun](https://github.com/sheerun))
498
-
499
537
  ## [v7.0.0.beta4](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta4) (2019-11-25)
500
538
 
501
539
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta3...v7.0.0.beta4)
@@ -510,7 +548,6 @@
510
548
 
511
549
  **Implemented enhancements:**
512
550
 
513
- - Just to keep track of this [\#445](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/445) ([mhenrixon](https://github.com/mhenrixon))
514
551
  - Brpoplpush redis script [\#434](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/434) ([mhenrixon](https://github.com/mhenrixon))
515
552
  - Drop support for almost EOL ruby 2.4 [\#433](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/433) ([mhenrixon](https://github.com/mhenrixon))
516
553
 
@@ -531,9 +568,13 @@
531
568
 
532
569
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta1...v7.0.0.beta2)
533
570
 
571
+ **Fixed bugs:**
572
+
573
+ - Pass redis\_version into scripts [\#431](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/431) ([mhenrixon](https://github.com/mhenrixon))
574
+
534
575
  **Closed issues:**
535
576
 
536
- - incorrect `:until\_and\_while\_executing` behavior [\#424](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/424)
577
+ - incorrect `:until_and_while_executing` behavior [\#424](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/424)
537
578
 
538
579
  ## [v7.0.0.beta1](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta1) (2019-10-07)
539
580
 
@@ -552,7 +593,6 @@
552
593
  **Fixed bugs:**
553
594
 
554
595
  - Allow Sidekiq::Context to be used for logging [\#429](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/429) ([mhenrixon](https://github.com/mhenrixon))
555
- - Fix v6 [\#428](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/428) ([mhenrixon](https://github.com/mhenrixon))
556
596
  - Fix sidekiq develop [\#426](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/426) ([mhenrixon](https://github.com/mhenrixon))
557
597
  - Reap as many orphans as advertised [\#403](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/403) ([mhenrixon](https://github.com/mhenrixon))
558
598
  - Reaper should remove :INFO keys [\#399](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/399) ([mhenrixon](https://github.com/mhenrixon))
@@ -572,13 +612,11 @@
572
612
  **Implemented enhancements:**
573
613
 
574
614
  - Lock both worker and queue [\#274](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/274)
575
- - Copy working setup from master [\#420](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/420) ([mhenrixon](https://github.com/mhenrixon))
576
615
 
577
616
  **Fixed bugs:**
578
617
 
579
618
  - Duplicate job was pushed \( v6.0.13 \) [\#414](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/414)
580
619
  - Constant SidekiqUniqueJobs::Web::Digests not found [\#396](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/396)
581
- - Include redis directory [\#430](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/430) ([mhenrixon](https://github.com/mhenrixon))
582
620
 
583
621
  **Closed issues:**
584
622
 
@@ -604,7 +642,7 @@
604
642
 
605
643
  **Closed issues:**
606
644
 
607
- - Unique args in combination with sidekiq cron contains `\_aj\_symbol\_keys` [\#363](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/363)
645
+ - Unique args in combination with sidekiq cron contains `_aj_symbol_keys` [\#363](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/363)
608
646
  - Low quality piece of shit [\#360](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/360)
609
647
  - Passthrough has been deprecated and will be removed in redis-namespace 2.0 [\#338](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/338)
610
648
 
@@ -633,6 +671,7 @@
633
671
  - Version 6: lets you schedule job with missing arguments [\#351](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/351)
634
672
  - Version 6 Ignores Jobs Enqueued in Version 5 [\#345](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/345)
635
673
  - Job will not enqueue even with no existing match [\#342](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/342)
674
+ - Convert v5 locks when needed [\#375](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/375) ([mhenrixon](https://github.com/mhenrixon))
636
675
 
637
676
  **Closed issues:**
638
677
 
@@ -696,7 +735,6 @@
696
735
  **Fixed bugs:**
697
736
 
698
737
  - Version 5: Job ID Hash Entries Not Removed if Unique Key Expires [\#346](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/346)
699
- - Convert v5 locks when needed [\#375](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/375) ([mhenrixon](https://github.com/mhenrixon))
700
738
  - Move the lpush last [\#354](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/354) ([mhenrixon](https://github.com/mhenrixon))
701
739
  - Convert expiration time to integer [\#330](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/330) ([dareddov](https://github.com/dareddov))
702
740
 
@@ -717,10 +755,6 @@
717
755
 
718
756
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.6...v5.0.11)
719
757
 
720
- **Fixed bugs:**
721
-
722
- - Always Remove Job ID from uniquejobs Hash [\#347](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/347) ([chadrschroeder](https://github.com/chadrschroeder))
723
-
724
758
  **Closed issues:**
725
759
 
726
760
  - concurrent-ruby 1.1.1 is causing this gem to break [\#340](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/340)
@@ -901,7 +935,6 @@
901
935
 
902
936
  - 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)
903
937
  - Unexpected behavior with until\_executed [\#250](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/250)
904
- - Code smells [\#275](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/275) ([mhenrixon](https://github.com/mhenrixon))
905
938
 
906
939
  **Fixed bugs:**
907
940
 
@@ -948,15 +981,9 @@
948
981
 
949
982
  **Implemented enhancements:**
950
983
 
984
+ - Code smells [\#275](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/275) ([mhenrixon](https://github.com/mhenrixon))
951
985
  - Reject while scheduling [\#273](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/273) ([mhenrixon](https://github.com/mhenrixon))
952
986
  - Improve testing [\#272](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/272) ([mhenrixon](https://github.com/mhenrixon))
953
-
954
- ## [v6.0.0.beta](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0.beta) (2018-06-17)
955
-
956
- [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v5.0.10...v6.0.0.beta)
957
-
958
- **Implemented enhancements:**
959
-
960
987
  - Until and while executing [\#271](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/271) ([mhenrixon](https://github.com/mhenrixon))
961
988
  - Solidify master [\#270](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/270) ([mhenrixon](https://github.com/mhenrixon))
962
989
  - Minor adjustments [\#268](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/268) ([mhenrixon](https://github.com/mhenrixon))
@@ -967,25 +994,29 @@
967
994
 
968
995
  - Allow `jobs keys` to default to listing all keys [\#252](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/252) ([soundasleep](https://github.com/soundasleep))
969
996
 
997
+ **Merged pull requests:**
998
+
999
+ - Improve documentation [\#269](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/269) ([mhenrixon](https://github.com/mhenrixon))
1000
+ - Remove unnecessary monkey patches for String [\#262](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/262) ([zormandi](https://github.com/zormandi))
1001
+ - README \> While Executing: remove unnecessary word [\#260](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/260) ([TimCannady](https://github.com/TimCannady))
1002
+ - Don't skip monkeypatches if ActiveSupport present [\#248](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/248) ([dleavitt](https://github.com/dleavitt))
1003
+ - Better runtime locks [\#241](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/241) ([mhenrixon](https://github.com/mhenrixon))
1004
+
1005
+ ## [v6.0.0.beta](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0.beta) (2018-06-17)
1006
+
1007
+ [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v5.0.10...v6.0.0.beta)
1008
+
970
1009
  **Closed issues:**
971
1010
 
972
1011
  - Incomplete sentence in README [\#264](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/264)
973
1012
  - ActiveJob and Sidekiq::Worker [\#259](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/259)
974
1013
  - ActiveJob and Sidekiq::Worker [\#258](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/258)
975
- - Non-unique jobs can be added even when `sidekiq\_options unique: :until\_executed` [\#251](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/251)
1014
+ - Non-unique jobs can be added even when `sidekiq_options unique: :until_executed` [\#251](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/251)
976
1015
  - Trouble with "inline" mode [\#243](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/243)
977
1016
  - Sidekiq::Worker.set not working with sidekiq-unique-jobs [\#242](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/242)
978
1017
  - sidekiq-unique-job with ActiveJob [\#238](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/238)
979
1018
  - Deadlock using :while\_executing? [\#233](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/233)
980
1019
 
981
- **Merged pull requests:**
982
-
983
- - Improve documentation [\#269](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/269) ([mhenrixon](https://github.com/mhenrixon))
984
- - Remove unnecessary monkey patches for String [\#262](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/262) ([zormandi](https://github.com/zormandi))
985
- - README \> While Executing: remove unnecessary word [\#260](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/260) ([TimCannady](https://github.com/TimCannady))
986
- - Don't skip monkeypatches if ActiveSupport present [\#248](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/248) ([dleavitt](https://github.com/dleavitt))
987
- - Better runtime locks [\#241](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/241) ([mhenrixon](https://github.com/mhenrixon))
988
-
989
1020
  ## [v5.0.10](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v5.0.10) (2017-08-19)
990
1021
 
991
1022
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v5.0.9...v5.0.10)
@@ -1196,7 +1227,7 @@
1196
1227
 
1197
1228
  - Can't schedule a job from another job [\#151](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/151)
1198
1229
  - perform\_in not working in version 4.0.9 [\#150](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/150)
1199
- - `unique: until\_and\_while\_executing` not working as expected [\#146](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/146)
1230
+ - `unique: until_and_while_executing` not working as expected [\#146](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/146)
1200
1231
  - while\_executing still runs duplicate tasks [\#136](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/136)
1201
1232
  - Version 4 Upgrade [\#133](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/133)
1202
1233
 
@@ -1337,7 +1368,7 @@
1337
1368
  - Testing [\#103](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/103)
1338
1369
  - Active Job [\#102](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/102)
1339
1370
  - Why is SidekiqUnique behaviour applied to regular Workers? [\#100](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/100)
1340
- - Confusing behavior when trying to `\[1,2,3\].each { |n| SomeJob.perform\_in\(n.seconds.from\_now, n\) }` never running, logging as duplicate value [\#98](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/98)
1371
+ - Confusing behavior when trying to `[1,2,3].each { |n| SomeJob.perform_in(n.seconds.from_now, n) }` never running, logging as duplicate value [\#98](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/98)
1341
1372
  - Scheduled jobs are not unlocked when deleted [\#97](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/97)
1342
1373
  - Testing functions should be moved out of production code [\#95](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/95)
1343
1374
  - Jobs can unlock mutexes they don't own [\#94](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/94)
@@ -1485,7 +1516,7 @@
1485
1516
 
1486
1517
  - Make unlock/yield order configurable. [\#21](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/21) ([endofunky](https://github.com/endofunky))
1487
1518
  - Rely on Sidekiq's String\#constantize extension instead of rolling our own [\#19](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/19) ([disbelief](https://github.com/disbelief))
1488
- - Attempt to constantize String `worker\_class` arguments passed to client middleware [\#17](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/17) ([disbelief](https://github.com/disbelief))
1519
+ - Attempt to constantize String `worker_class` arguments passed to client middleware [\#17](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/17) ([disbelief](https://github.com/disbelief))
1489
1520
  - Compatibility with Sidekiq 2.12.1 Scheduled Jobs [\#16](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/16) ([lsimoneau](https://github.com/lsimoneau))
1490
1521
  - Allow worker to specify which arguments to include in uniquing hash [\#12](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/12) ([sax](https://github.com/sax))
1491
1522
  - Add support for unique when using Sidekiq's delay function [\#11](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/11) ([eduardosasso](https://github.com/eduardosasso))
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
- # SidekiqUniqueJobs [![Join the chat at https://gitter.im/mhenrixon/sidekiq-unique-jobs](https://badges.gitter.im/mhenrixon/sidekiq-unique-jobs.svg)](https://gitter.im/mhenrixon/sidekiq-unique-jobs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://travis-ci.org/mhenrixon/sidekiq-unique-jobs.svg?branch=master)](https://travis-ci.org/mhenrixon/sidekiq-unique-jobs) [![Code Climate](https://codeclimate.com/github/mhenrixon/sidekiq-unique-jobs.svg)](https://codeclimate.com/github/mhenrixon/sidekiq-unique-jobs) [![Test Coverage](https://codeclimate.com/github/mhenrixon/sidekiq-unique-jobs/badges/coverage.svg)](https://codeclimate.com/github/mhenrixon/sidekiq-unique-jobs/coverage)
1
+ # SidekiqUniqueJobs
2
+
3
+ [![Join the chat at https://gitter.im/mhenrixon/sidekiq-unique-jobs](https://badges.gitter.im/mhenrixon/sidekiq-unique-jobs.svg)](https://gitter.im/mhenrixon/sidekiq-unique-jobs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) ![Build Status](https://github.com/mhenrixon/sidekiq-unique-jobs/actions/workflows/rspec.yml/badge.svg?branch=master) [![Code Climate](https://codeclimate.com/github/mhenrixon/sidekiq-unique-jobs.svg)](https://codeclimate.com/github/mhenrixon/sidekiq-unique-jobs) [![Test Coverage](https://codeclimate.com/github/mhenrixon/sidekiq-unique-jobs/badges/coverage.svg)](https://codeclimate.com/github/mhenrixon/sidekiq-unique-jobs/coverage)
2
4
 
3
5
  <!-- MarkdownTOC -->
4
6
 
@@ -905,11 +907,11 @@ end
905
907
 
906
908
  It is recommended to leave the uniqueness testing to the gem maintainers. If you care about how the gem is integration tested have a look at the following specs:
907
909
 
908
- - [spec/integration/sidekiq_unique_jobs/lock/until_and_while_executing_spec.rb](https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/spec/integration/sidekiq_unique_jobs/lock/until_and_while_executing_spec.rb)
909
- - [spec/integration/sidekiq_unique_jobs/lock/until_executed_spec.rb](https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/spec/integration/sidekiq_unique_jobs/lock/until_executed_spec.rb)
910
- - [spec/integration/sidekiq_unique_jobs/lock/until_expired_spec.rb](https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/spec/integration/sidekiq_unique_jobs/lock/until_expired_spec.rb)
911
- - [spec/integration/sidekiq_unique_jobs/lock/while_executing_reject_spec.rb](https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/spec/integration/sidekiq_unique_jobs/lock/while_executing_reject_spec.rb)
912
- - [spec/integration/sidekiq_unique_jobs/lock/while_executing_spec.rb](https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/spec/integration/sidekiq_unique_jobs/lock/while_executing_spec.rb)
910
+ - [spec/sidekiq_unique_jobs/lock/until_and_while_executing_spec.rb](https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/spec/sidekiq_unique_jobs/lock/until_and_while_executing_spec.rb)
911
+ - [spec/sidekiq_unique_jobs/lock/until_executed_spec.rb](https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/spec/sidekiq_unique_jobs/lock/until_executed_spec.rb)
912
+ - [spec/sidekiq_unique_jobs/lock/until_expired_spec.rb](https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/spec/sidekiq_unique_jobs/lock/until_expired_spec.rb)
913
+ - [spec/sidekiq_unique_jobs/lock/while_executing_reject_spec.rb](https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/spec/sidekiq_unique_jobs/lock/while_executing_reject_spec.rb)
914
+ - [spec/sidekiq_unique_jobs/lock/while_executing_spec.rb](https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/spec/sidekiq_unique_jobs/lock/while_executing_spec.rb)
913
915
 
914
916
  ## Contributing
915
917
 
@@ -68,8 +68,8 @@ module SidekiqUniqueJobs
68
68
  end
69
69
 
70
70
  [
71
- total_size,
72
- result[0], # next_cursor
71
+ total_size.to_i,
72
+ result[0].to_i, # next_cursor
73
73
  result[1].map { |entry| load_json(entry[0]) }, # entries
74
74
  ]
75
75
  end
@@ -104,8 +104,8 @@ module SidekiqUniqueJobs
104
104
  end
105
105
 
106
106
  [
107
- total_size,
108
- digests[0], # next_cursor
107
+ total_size.to_i,
108
+ digests[0].to_i, # next_cursor
109
109
  digests[1].map { |digest, score| Lock.new(digest, time: score) }, # entries
110
110
  ]
111
111
  end
@@ -124,7 +124,7 @@ module SidekiqUniqueJobs
124
124
  attr_reader :attempt
125
125
 
126
126
  def unlock_with_callback
127
- return log_warn("might need to be unlocked manually") unless unlock
127
+ return log_warn("Might need to be unlocked manually", item) unless unlock
128
128
 
129
129
  callback_safely
130
130
  item[JID]
@@ -134,7 +134,7 @@ module SidekiqUniqueJobs
134
134
  callback&.call
135
135
  item[JID]
136
136
  rescue StandardError
137
- log_warn("unlocked successfully but the #after_unlock callback failed!")
137
+ log_warn("Unlocked successfully but the #after_unlock callback failed!", item)
138
138
  raise
139
139
  end
140
140
 
@@ -21,7 +21,7 @@ module SidekiqUniqueJobs
21
21
  runtime_lock.execute { return yield }
22
22
  end
23
23
  else
24
- log_warn "couldn't unlock digest: #{item[LOCK_DIGEST]} #{item[JID]}"
24
+ log_warn("Couldn't unlock digest: #{item[LOCK_DIGEST]}, jid: #{item[JID]}")
25
25
  end
26
26
  end
27
27
 
@@ -30,7 +30,7 @@ module SidekiqUniqueJobs
30
30
  def lock_on_failure
31
31
  yield
32
32
  rescue Exception # rubocop:disable Lint/RescueException
33
- log_error("Runtime lock failed to execute job, restoring server lock")
33
+ log_error("Runtime lock failed to execute job, restoring server lock", item)
34
34
  lock
35
35
  raise
36
36
  end
@@ -58,7 +58,7 @@ module SidekiqUniqueJobs
58
58
 
59
59
  def initialize(job_hash = {})
60
60
  @type = job_hash[LOCK]&.to_sym
61
- @worker = job_hash[CLASS]
61
+ @worker = SidekiqUniqueJobs.constantize(job_hash[CLASS])
62
62
  @limit = job_hash.fetch(LOCK_LIMIT, 1)
63
63
  @timeout = job_hash.fetch(LOCK_TIMEOUT, 0)
64
64
  @ttl = job_hash.fetch(LOCK_TTL) { job_hash.fetch(LOCK_EXPIRATION, nil) }.to_i
@@ -71,6 +71,10 @@ module SidekiqUniqueJobs
71
71
  @on_server_conflict = job_hash[ON_SERVER_CONFLICT]
72
72
  end
73
73
 
74
+ def lock_info?
75
+ lock_info
76
+ end
77
+
74
78
  #
75
79
  # Indicate if timeout was set
76
80
  #
@@ -199,7 +199,7 @@ module SidekiqUniqueJobs
199
199
  def primed_async(conn)
200
200
  return yield if Concurrent::Promises
201
201
  .future(conn) { |red_con| pop_queued(red_con) }
202
- .value(drift(config.ttl))
202
+ .value(add_drift(config.ttl))
203
203
 
204
204
  warn_about_timeout
205
205
  end
@@ -220,7 +220,7 @@ module SidekiqUniqueJobs
220
220
  enqueue(conn) do
221
221
  primed_sync(conn) do
222
222
  locked_token = call_script(:lock, key.to_a, argv, conn)
223
- return yield if locked_token
223
+ return yield locked_token if locked_token
224
224
  end
225
225
  end
226
226
  end
@@ -235,7 +235,9 @@ module SidekiqUniqueJobs
235
235
  # @return [Object] whatever the block returns when lock was acquired
236
236
  #
237
237
  def primed_sync(conn)
238
- return yield if pop_queued(conn)
238
+ if (popped_jid = pop_queued(conn))
239
+ return yield popped_jid
240
+ end
239
241
 
240
242
  warn_about_timeout
241
243
  end
@@ -260,7 +262,7 @@ module SidekiqUniqueJobs
260
262
  #
261
263
  def brpoplpush(conn)
262
264
  # passing timeout 0 to brpoplpush causes it to block indefinitely
263
- conn.brpoplpush(key.queued, key.primed, timeout: config.timeout || 0)
265
+ conn.brpoplpush(key.queued, key.primed, timeout: config.timeout)
264
266
  end
265
267
 
266
268
  #
@@ -288,7 +290,7 @@ module SidekiqUniqueJobs
288
290
  return unless queued_token && (validity >= 0 || config.pttl.zero?)
289
291
 
290
292
  write_lock_info(conn)
291
- yield
293
+ yield queued_token
292
294
  end
293
295
 
294
296
  #
@@ -299,7 +301,7 @@ module SidekiqUniqueJobs
299
301
  # @return [void]
300
302
  #
301
303
  def write_lock_info(conn)
302
- return unless config.lock_info
304
+ return unless config.lock_info?
303
305
 
304
306
  conn.set(key.info, lock_info)
305
307
  end
@@ -315,7 +317,11 @@ module SidekiqUniqueJobs
315
317
  # Add 2 milliseconds to the drift to account for Redis expires
316
318
  # precision, which is 1 millisecond, plus 1 millisecond min drift
317
319
  # for small TTLs.
318
- (val.to_i * CLOCK_DRIFT_FACTOR).to_i + 2
320
+ (val + 2).to_f * CLOCK_DRIFT_FACTOR
321
+ end
322
+
323
+ def add_drift(val)
324
+ val + drift(val)
319
325
  end
320
326
 
321
327
  #
@@ -340,7 +346,7 @@ module SidekiqUniqueJobs
340
346
  LIMIT => item[LOCK_LIMIT],
341
347
  TIMEOUT => item[LOCK_TIMEOUT],
342
348
  TTL => item[LOCK_TTL],
343
- LOCK => config.type,
349
+ TYPE => config.type,
344
350
  LOCK_ARGS => item[LOCK_ARGS],
345
351
  TIME => now_f,
346
352
  )
@@ -29,8 +29,9 @@ module SidekiqUniqueJobs
29
29
  #
30
30
  # @yield [String, Exception] the message or exception to use for log message
31
31
  #
32
- def log_debug(message_or_exception = nil, &block)
33
- logger.debug(message_or_exception, &block)
32
+ def log_debug(message_or_exception = nil, item = nil, &block)
33
+ message = build_message(message_or_exception, item)
34
+ logger.debug(message, &block)
34
35
  nil
35
36
  end
36
37
 
@@ -43,8 +44,9 @@ module SidekiqUniqueJobs
43
44
  #
44
45
  # @yield [String, Exception] the message or exception to use for log message
45
46
  #
46
- def log_info(message_or_exception = nil, &block)
47
- logger.info(message_or_exception, &block)
47
+ def log_info(message_or_exception = nil, item = nil, &block)
48
+ message = build_message(message_or_exception, item)
49
+ logger.info(message, &block)
48
50
  nil
49
51
  end
50
52
 
@@ -57,8 +59,9 @@ module SidekiqUniqueJobs
57
59
  #
58
60
  # @yield [String, Exception] the message or exception to use for log message
59
61
  #
60
- def log_warn(message_or_exception = nil, &block)
61
- logger.warn(message_or_exception, &block)
62
+ def log_warn(message_or_exception = nil, item = nil, &block)
63
+ message = build_message(message_or_exception, item)
64
+ logger.warn(message, &block)
62
65
  nil
63
66
  end
64
67
 
@@ -71,8 +74,9 @@ module SidekiqUniqueJobs
71
74
  #
72
75
  # @yield [String, Exception] the message or exception to use for log message
73
76
  #
74
- def log_error(message_or_exception = nil, &block)
75
- logger.error(message_or_exception, &block)
77
+ def log_error(message_or_exception = nil, item = nil, &block)
78
+ message = build_message(message_or_exception, item)
79
+ logger.error(message, &block)
76
80
  nil
77
81
  end
78
82
 
@@ -85,11 +89,27 @@ module SidekiqUniqueJobs
85
89
  #
86
90
  # @yield [String, Exception] the message or exception to use for log message
87
91
  #
88
- def log_fatal(message_or_exception = nil, &block)
89
- logger.fatal(message_or_exception, &block)
92
+ def log_fatal(message_or_exception = nil, item = nil, &block)
93
+ message = build_message(message_or_exception, item)
94
+ logger.fatal(message, &block)
90
95
  nil
91
96
  end
92
97
 
98
+ def build_message(message_or_exception, item = nil)
99
+ return nil if message_or_exception.nil?
100
+ return message_or_exception if item.nil?
101
+
102
+ message = message_or_exception.dup
103
+ details = item.slice(LOCK, QUEUE, CLASS, JID, LOCK_DIGEST).each_with_object([]) do |(key, value), memo|
104
+ memo << "#{key}=#{value}"
105
+ end
106
+ message << " ("
107
+ message << details.join(" ")
108
+ message << ")"
109
+
110
+ message
111
+ end
112
+
93
113
  #
94
114
  # Wraps the middleware logic with context aware logging
95
115
  #
@@ -172,7 +192,7 @@ module SidekiqUniqueJobs
172
192
  end
173
193
 
174
194
  def sidekiq_logger_context_method
175
- logger.method(:with_context) if logger_respond_to_with_context?
195
+ logger.method(:with_context) if logger_respond_to_with_context?
176
196
  end
177
197
 
178
198
  def sidekiq_logging_context_method
@@ -152,6 +152,8 @@ module SidekiqUniqueJobs
152
152
  end
153
153
 
154
154
  def match?(key_one, key_two)
155
+ return false if key_one.nil? || key_two.nil?
156
+
155
157
  key_one.delete_suffix(RUN_SUFFIX) == key_two.delete_suffix(RUN_SUFFIX)
156
158
  end
157
159
 
@@ -236,4 +236,23 @@ module SidekiqUniqueJobs
236
236
  lock_config = validate_worker(options)
237
237
  raise InvalidWorker, lock_config unless lock_config.errors.empty?
238
238
  end
239
+
240
+ # Attempt to constantize a string worker_class argument, always
241
+ # failing back to the original argument when the constant can't be found
242
+ #
243
+ # @return [Sidekiq::Worker]
244
+ def constantize(str)
245
+ return str.class if str.is_a?(Sidekiq::Worker) # sidekiq v6.x
246
+ return str unless str.is_a?(String)
247
+ return Object.const_get(str) unless str.include?("::")
248
+
249
+ names = str.split("::")
250
+ names.shift if names.empty? || names.first.empty?
251
+
252
+ names.inject(Object) do |constant, name|
253
+ # the false flag limits search for name to under the constant namespace
254
+ # which mimics Rails' behaviour
255
+ constant.const_get(name, false)
256
+ end
257
+ end
239
258
  end
@@ -49,10 +49,7 @@ module SidekiqUniqueJobs
49
49
  #
50
50
  # @return [Sidekiq::Worker]
51
51
  def worker_class_constantize(klazz = @worker_class)
52
- return klazz.class if klazz.is_a?(Sidekiq::Worker) # sidekiq v6.x
53
- return klazz unless klazz.is_a?(String)
54
-
55
- Object.const_get(klazz)
52
+ SidekiqUniqueJobs.constantize(klazz)
56
53
  rescue NameError => ex
57
54
  case ex.message
58
55
  when /uninitialized constant/
@@ -3,5 +3,5 @@
3
3
  module SidekiqUniqueJobs
4
4
  #
5
5
  # @return [String] the current SidekiqUniqueJobs version
6
- VERSION = "7.0.5"
6
+ VERSION = "7.0.10"
7
7
  end
@@ -19,8 +19,11 @@ module SidekiqUniqueJobs
19
19
  @count = (params[:count] || 100).to_i
20
20
  @current_cursor = params[:cursor]
21
21
  @prev_cursor = params[:prev_cursor]
22
- @pagination = { pattern: @filter, cursor: @current_cursor, page_size: @count }
23
- @total_size, @next_cursor, @changelogs = changelog.page(**@pagination)
22
+ @total_size, @next_cursor, @changelogs = changelog.page(
23
+ cursor: @current_cursor,
24
+ pattern: @filter,
25
+ page_size: @count,
26
+ )
24
27
 
25
28
  erb(unique_template(:changelogs))
26
29
  end
@@ -36,8 +39,12 @@ module SidekiqUniqueJobs
36
39
  @count = (params[:count] || 100).to_i
37
40
  @current_cursor = params[:cursor]
38
41
  @prev_cursor = params[:prev_cursor]
39
- @pagination = { pattern: @filter, cursor: @current_cursor, page_size: @count }
40
- @total_size, @next_cursor, @locks = digests.page(**@pagination)
42
+
43
+ @total_size, @next_cursor, @locks = digests.page(
44
+ cursor: @current_cursor,
45
+ pattern: @filter,
46
+ page_size: @count,
47
+ )
41
48
 
42
49
  erb(unique_template(:locks))
43
50
  end
@@ -13,7 +13,9 @@ module SidekiqUniqueJobs
13
13
  VIEW_PATH = File.expand_path("../web/views", __dir__).freeze
14
14
  #
15
15
  # @return [Array<String>] safe params
16
- SAFE_CPARAMS = %w[cursor prev_cursor].freeze
16
+ SAFE_CPARAMS = %w[
17
+ filter count cursor prev_cursor poll direction
18
+ ].freeze
17
19
 
18
20
  extend self
19
21
 
@@ -67,10 +69,8 @@ module SidekiqUniqueJobs
67
69
  # @return [String] a url safe parameter string
68
70
  #
69
71
  def cparams(options)
70
- # stringify
71
- options.transform_keys(&:to_s)
72
-
73
- params.merge(options).map do |key, value|
72
+ stringified_options = options.transform_keys(&:to_s)
73
+ params.merge(stringified_options).map do |key, value|
74
74
  next unless SAFE_CPARAMS.include?(key)
75
75
 
76
76
  "#{key}=#{CGI.escape(value.to_s)}"
@@ -1,10 +1,10 @@
1
1
  <ul class="pagination pull-right flip">
2
2
  <% if @prev_cursor %>
3
- <li>
4
- <a href="<%= url %>?<%= cparams(cursor: @prev_cursor, prev_cursor: @next_cursor) %>">Previous <%= @count %></a>
5
- </li>
3
+ <li>
4
+ <a href="<%= url %>?<%= cparams(filter: @filter, cursor: @prev_cursor, prev_cursor: @next_cursor) %>">Previous <%= @count %></a>
5
+ </li>
6
6
  <% end %>
7
7
  <li>
8
- <a href="<%= url %>?<%= cparams(cursor: @next_cursor, prev_cursor: @current_cursor) %>">Next <%= @count %></a>
8
+ <a href="<%= url %>?<%= cparams(filter: @filter, cursor: @next_cursor, prev_cursor: @current_cursor) %>">Next <%= @count %></a>
9
9
  </li>
10
10
  </ul>
@@ -36,7 +36,7 @@
36
36
  </thead>
37
37
  <tbody>
38
38
  <% @changelogs.each do |changelog| %>
39
- <tr>
39
+ <tr class="changelog-row">
40
40
  <td><%= safe_relative_time(changelog["time"]) %></td>
41
41
  <td><%= changelog["digest"] %></td>
42
42
  <td><%= changelog["script"] %></td>
@@ -11,7 +11,7 @@
11
11
  <%= t('Filter') %>
12
12
  </button>
13
13
  </form>
14
- <% if @locks.any? && @total_size > @count.to_i %>
14
+ <% if @locks.any? && @total_size > @count %>
15
15
  <div class="col-sm-4">
16
16
  <%= erb unique_template(:_paging), locals: { url: "#{root_path}locks" } %>
17
17
  </div>
@@ -30,20 +30,22 @@
30
30
  </tr>
31
31
  </thead>
32
32
  <% @locks.each do |lock| %>
33
- <tr>
34
- <td>
35
- <form action="<%= root_path %>locks/<%= lock.key %>/delete" method="get">
36
- <%= csrf_tag %>
37
- <input name="lock" value="<%= h lock.key %>" type="hidden" />
38
- <input class="btn btn-danger btn-xs" type="submit" name="delete" value="<%= t('Delete') %>" data-confirm="<%= t('AreYouSure') %>" />
39
- </form>
40
- </td>
41
- <td><a href="<%= root_path %>locks/<%= lock.key %>"><%= lock.key %></a></td>
42
- <td><%= lock.info["lock"] %></th>
43
- <td><%= lock.locked.count %></td>
44
- <td><%= safe_relative_time(lock.created_at) %></td>
45
- </tr>
46
- <% end %>
33
+ <tbody>
34
+ <tr class="lock-row">
35
+ <td>
36
+ <form action="<%= root_path %>locks/<%= lock.key %>/delete" method="get">
37
+ <%= csrf_tag %>
38
+ <input name="lock" value="<%= h lock.key %>" type="hidden" />
39
+ <input class="btn btn-danger btn-xs" type="submit" name="delete" value="<%= t('Delete') %>" data-confirm="<%= t('AreYouSure') %>" />
40
+ </form>
41
+ </td>
42
+ <td><a href="<%= root_path %>locks/<%= lock.key %>"><%= lock.key %></a></td>
43
+ <td><%= lock.info["lock"] %></td>
44
+ <td><%= lock.locked.count %></td>
45
+ <td><%= safe_relative_time(lock.created_at) %></td>
46
+ </tr>
47
+ </tbody>
48
+ <% end %>
47
49
  </table>
48
50
  <form action="<%= root_path %>locks/delete_all" method="get">
49
51
  <input class="btn btn-danger btn-xs" type="submit" name="delete_all" value="<%= t('DeleteAll') %>" data-confirm="<%= t('AreYouSure') %>" />
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.5
4
+ version: 7.0.10
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-03-18 00:00:00.000000000 Z
11
+ date: 2021-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: brpoplpush-redis_script
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.0.0
19
+ version: 0.1.1
20
20
  - - "<="
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.0.0
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">"
28
28
  - !ruby/object:Gem::Version
29
- version: 0.0.0
29
+ version: 0.1.1
30
30
  - - "<="
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.0.0
@@ -257,7 +257,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
257
257
  - !ruby/object:Gem::Version
258
258
  version: '0'
259
259
  requirements: []
260
- rubygems_version: 3.2.6
260
+ rubygems_version: 3.2.16
261
261
  signing_key:
262
262
  specification_version: 4
263
263
  summary: Sidekiq middleware that prevents duplicates jobs