sidekiq-unique-jobs 7.0.0 → 7.0.1

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: 3a0ef0c8257f0c79b137bab502492428dcbd9060b44d1b1fa754e5c591ef9185
4
- data.tar.gz: '03380b590a1e077f429e2b9bce284716b6f6d891cf35a1eeb7c01e82b2b23782'
3
+ metadata.gz: 791ef31e7978f706fa00198280417ebb4f230d8bf5225f5e914cc8092b347b1e
4
+ data.tar.gz: b085a1ac1974d74a73248cd931eff8a387f5017e06e66a863844616e6ac29184
5
5
  SHA512:
6
- metadata.gz: b7c5881985fd2b2d96a2af3ad29e39e56a1df353b888e0a10720d4bee03cebeafee05e327b5fe54f809b0a1e567f0466e5754bee4e5e0179d14ce232a39a1e8b
7
- data.tar.gz: 4fa3667cb51c5b44791b10f3672dbebd5f3733adae80b512775629a29d3feed4e67c5df8ce20993fa89d4810a6ca9aef7c0922e1f03bd305e0421679316ba3f9
6
+ metadata.gz: 71cb338220b1d3bb77b9834f5c4fe42c48532b95bf794bbad286382f1a12297b8411276b1e802c921203a345fd25151feb22b63dd284d111eea2018f29ec4ea1
7
+ data.tar.gz: 7cca4aa29025359b33cd914b402c446a4e9b03cb98f3b0839732d2bae03b2503f5d3425d57cd2efbd4705a438c334b36f8dd2b60a279cf8e505b188c4a3003bc
@@ -1,9 +1,38 @@
1
1
  # Changelog
2
2
 
3
+ ## [Unreleased](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/HEAD)
4
+
5
+ [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0...HEAD)
6
+
7
+
8
+
9
+ ## [v7.0.0](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0) (2021-01-20)
10
+
11
+ [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.25...v7.0.0)
12
+
13
+ **Implemented enhancements:**
14
+
15
+ - Give user full control over adding middleware [\#566](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/566) ([mhenrixon](https://github.com/mhenrixon))
16
+
17
+ **Fixed bugs:**
18
+
19
+ - Race condition in ruby reaper [\#559](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/559)
20
+ - Fix until and while executed and improve documentation [\#397](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/397)
21
+ - Fix 532 [\#549](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/549) ([mhenrixon](https://github.com/mhenrixon))
22
+
23
+ **Closed issues:**
24
+
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
+ - Is it possible to have a :until\_executed lock with an expiration time? [\#524](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/524)
27
+
3
28
  ## [v7.0.0.beta29](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta29) (2021-01-16)
4
29
 
5
30
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta28...v7.0.0.beta29)
6
31
 
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
+
7
36
  **Fixed bugs:**
8
37
 
9
38
  - Ruby Reaper active check incorrect [\#557](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/557)
@@ -21,6 +50,7 @@
21
50
 
22
51
  - 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)
23
52
  - 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))
24
54
  - Fix active check for the worker hash [\#558](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/558) ([mhenrixon](https://github.com/mhenrixon))
25
55
  - Prefer lock\_prefix not unique\_prefix [\#554](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/554) ([mhenrixon](https://github.com/mhenrixon))
26
56
  - Fix issue 432 [\#552](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/552) ([mhenrixon](https://github.com/mhenrixon))
@@ -135,6 +165,7 @@
135
165
  **Fixed bugs:**
136
166
 
137
167
  - 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))
138
169
 
139
170
  **Closed issues:**
140
171
 
@@ -216,7 +247,6 @@
216
247
  - Brpoplpush::RedisScript::LuaError: WRONGTYPE Operation against a key holding the wrong kind of value [\#491](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/491)
217
248
  - Lua script bug [\#489](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/489)
218
249
  - Reaper will delete locks for running jobs [\#488](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/488)
219
- - Fix access to hash members [\#496](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/496) ([mhenrixon](https://github.com/mhenrixon))
220
250
  - Fix cursor assignment [\#494](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/494) ([mhenrixon](https://github.com/mhenrixon))
221
251
  - Prevent reaping of active jobs [\#493](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/493) ([mhenrixon](https://github.com/mhenrixon))
222
252
 
@@ -234,6 +264,7 @@
234
264
 
235
265
  **Fixed bugs:**
236
266
 
267
+ - Fix access to hash members [\#496](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/496) ([mhenrixon](https://github.com/mhenrixon))
237
268
  - Use thread-safe digest creation mechanism [\#484](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/484) ([mhenrixon](https://github.com/mhenrixon))
238
269
 
239
270
  ## [v7.0.0.beta13](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta13) (2020-03-26)
@@ -274,6 +305,10 @@
274
305
 
275
306
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta10...v7.0.0.beta11)
276
307
 
308
+ **Fixed bugs:**
309
+
310
+ - Only configure RSpec when constant is defined [\#477](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/477) ([mhenrixon](https://github.com/mhenrixon))
311
+
277
312
  ## [v7.0.0.beta10](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta10) (2020-03-21)
278
313
 
279
314
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.19...v7.0.0.beta10)
@@ -288,7 +323,6 @@
288
323
  **Fixed bugs:**
289
324
 
290
325
  - With v6.0.18, Sidekiq doesn't run at all [\#471](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/471)
291
- - Only configure RSpec when constant is defined [\#477](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/477) ([mhenrixon](https://github.com/mhenrixon))
292
326
  - Fix errors\_as\_string on lock\_config.rb [\#469](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/469) ([donaldpiret](https://github.com/donaldpiret))
293
327
 
294
328
  **Merged pull requests:**
@@ -428,6 +462,7 @@
428
462
  **Fixed bugs:**
429
463
 
430
464
  - Redis is busy running script and script never terminates [\#441](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/441)
465
+ - Make the ruby reaper plain ruby [\#443](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/443) ([mhenrixon](https://github.com/mhenrixon))
431
466
 
432
467
  **Closed issues:**
433
468
 
@@ -443,7 +478,6 @@
443
478
 
444
479
  **Fixed bugs:**
445
480
 
446
- - Make the ruby reaper plain ruby [\#443](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/443) ([mhenrixon](https://github.com/mhenrixon))
447
481
  - Pass redis\_version into scripts [\#431](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/431) ([mhenrixon](https://github.com/mhenrixon))
448
482
 
449
483
  **Closed issues:**
@@ -466,6 +500,7 @@
466
500
 
467
501
  **Fixed bugs:**
468
502
 
503
+ - Include redis directory [\#430](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/430) ([mhenrixon](https://github.com/mhenrixon))
469
504
  - Allow Sidekiq::Context to be used for logging [\#429](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/429) ([mhenrixon](https://github.com/mhenrixon))
470
505
  - Fix sidekiq develop [\#426](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/426) ([mhenrixon](https://github.com/mhenrixon))
471
506
  - Reap as many orphans as advertised [\#403](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/403) ([mhenrixon](https://github.com/mhenrixon))
@@ -492,7 +527,6 @@
492
527
 
493
528
  - Duplicate job was pushed \( v6.0.13 \) [\#414](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/414)
494
529
  - Constant SidekiqUniqueJobs::Web::Digests not found [\#396](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/396)
495
- - Include redis directory [\#430](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/430) ([mhenrixon](https://github.com/mhenrixon))
496
530
  - Fix v6 [\#428](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/428) ([mhenrixon](https://github.com/mhenrixon))
497
531
 
498
532
  **Closed issues:**
@@ -586,6 +620,10 @@
586
620
 
587
621
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.7...v6.0.8)
588
622
 
623
+ **Fixed bugs:**
624
+
625
+ - Close \#359 [\#364](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/364) ([mhenrixon](https://github.com/mhenrixon))
626
+
589
627
  **Closed issues:**
590
628
 
591
629
  - Automatic unlock of jobs [\#362](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/362)
@@ -608,9 +646,8 @@
608
646
  **Fixed bugs:**
609
647
 
610
648
  - Version 5: Job ID Hash Entries Not Removed if Unique Key Expires [\#346](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/346)
611
- - Close \#359 [\#364](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/364) ([mhenrixon](https://github.com/mhenrixon))
612
649
  - Move the lpush last [\#354](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/354) ([mhenrixon](https://github.com/mhenrixon))
613
- - Convert expiration time to integer [\#330](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/330) ([dareddov](https://github.com/dareddov))
650
+ - Fix the broken expiration [\#316](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/316) ([mhenrixon](https://github.com/mhenrixon))
614
651
 
615
652
  **Closed issues:**
616
653
 
@@ -623,6 +660,7 @@
623
660
  - fix CHANGELOG syntax [\#344](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/344) ([timoschilling](https://github.com/timoschilling))
624
661
  - Define Config class inside SidekiqUniqueJobs module [\#343](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/343) ([Slike9](https://github.com/Slike9))
625
662
  - fix readme testing section [\#333](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/333) ([edmartins](https://github.com/edmartins))
663
+ - Fix typo in documentation \[ci-skip\] [\#327](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/327) ([mhenrixon](https://github.com/mhenrixon))
626
664
 
627
665
  ## [v5.0.11](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v5.0.11) (2018-11-19)
628
666
 
@@ -631,6 +669,7 @@
631
669
  **Fixed bugs:**
632
670
 
633
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))
634
673
 
635
674
  **Closed issues:**
636
675
 
@@ -667,18 +706,10 @@
667
706
 
668
707
  - Why is lock\_timeout: nil VERY DANGEROUS? [\#313](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/313)
669
708
 
670
- **Merged pull requests:**
671
-
672
- - Fix typo in documentation \[ci-skip\] [\#327](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/327) ([mhenrixon](https://github.com/mhenrixon))
673
-
674
709
  ## [v6.0.4](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.4) (2018-08-02)
675
710
 
676
711
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.3...v6.0.4)
677
712
 
678
- **Fixed bugs:**
679
-
680
- - Fix the broken expiration [\#316](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/316) ([mhenrixon](https://github.com/mhenrixon))
681
-
682
713
  **Closed issues:**
683
714
 
684
715
  - Question about until\_timeout with 6.0.0 [\#303](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/303)
@@ -726,6 +757,7 @@
726
757
 
727
758
  - Dead jobs [\#308](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/308) ([mhenrixon](https://github.com/mhenrixon))
728
759
  - 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))
729
761
 
730
762
  ## [v6.0.0](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0) (2018-07-27)
731
763
 
@@ -744,7 +776,6 @@
744
776
  **Merged pull requests:**
745
777
 
746
778
  - Add more details about testing uniqueness [\#301](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/301) ([mhenrixon](https://github.com/mhenrixon))
747
- - Update README.md [\#300](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/300) ([pirj](https://github.com/pirj))
748
779
 
749
780
  ## [v6.0.0.rc7](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0.rc7) (2018-07-23)
750
781
 
@@ -789,7 +820,6 @@
789
820
  **Fixed bugs:**
790
821
 
791
822
  - bundle exec jobs console does not work [\#253](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/253)
792
- - Rename command line binary [\#287](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/287) ([mhenrixon](https://github.com/mhenrixon))
793
823
 
794
824
  ## [v6.0.0.rc4](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0.rc4) (2018-06-30)
795
825
 
@@ -797,15 +827,16 @@
797
827
 
798
828
  **Implemented enhancements:**
799
829
 
830
+ - Prepare for v6 [\#286](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/286) ([mhenrixon](https://github.com/mhenrixon))
800
831
  - Only unlock not delete [\#285](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/285) ([mhenrixon](https://github.com/mhenrixon))
801
832
 
802
- ## [v6.0.0.rc3](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0.rc3) (2018-06-29)
833
+ **Fixed bugs:**
803
834
 
804
- [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.0.rc2...v6.0.0.rc3)
835
+ - Rename command line binary [\#287](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/287) ([mhenrixon](https://github.com/mhenrixon))
805
836
 
806
- **Implemented enhancements:**
837
+ ## [v6.0.0.rc3](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0.rc3) (2018-06-29)
807
838
 
808
- - Prepare for v6 [\#286](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/286) ([mhenrixon](https://github.com/mhenrixon))
839
+ [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.0.rc2...v6.0.0.rc3)
809
840
 
810
841
  **Fixed bugs:**
811
842
 
@@ -819,7 +850,6 @@
819
850
 
820
851
  - 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)
821
852
  - Unexpected behavior with until\_executed [\#250](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/250)
822
- - Fix UntilExpired [\#278](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/278) ([mhenrixon](https://github.com/mhenrixon))
823
853
 
824
854
  **Fixed bugs:**
825
855
 
@@ -849,6 +879,7 @@
849
879
  - Legacy support [\#280](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/280)
850
880
  - Adds legacy support [\#281](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/281) ([mhenrixon](https://github.com/mhenrixon))
851
881
  - Adds guard-reek [\#279](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/279) ([mhenrixon](https://github.com/mhenrixon))
882
+ - Fix UntilExpired [\#278](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/278) ([mhenrixon](https://github.com/mhenrixon))
852
883
 
853
884
  ## [v6.0.0.beta2](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0.beta2) (2018-06-25)
854
885
 
@@ -866,7 +897,6 @@
866
897
  **Implemented enhancements:**
867
898
 
868
899
  - Code smells [\#275](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/275) ([mhenrixon](https://github.com/mhenrixon))
869
- - Reject while scheduling [\#273](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/273) ([mhenrixon](https://github.com/mhenrixon))
870
900
  - Improve testing [\#272](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/272) ([mhenrixon](https://github.com/mhenrixon))
871
901
 
872
902
  ## [v6.0.0.beta](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0.beta) (2018-06-17)
@@ -875,6 +905,7 @@
875
905
 
876
906
  **Implemented enhancements:**
877
907
 
908
+ - Reject while scheduling [\#273](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/273) ([mhenrixon](https://github.com/mhenrixon))
878
909
  - Until and while executing [\#271](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/271) ([mhenrixon](https://github.com/mhenrixon))
879
910
  - Solidify master [\#270](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/270) ([mhenrixon](https://github.com/mhenrixon))
880
911
  - Minor adjustments [\#268](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/268) ([mhenrixon](https://github.com/mhenrixon))
@@ -1288,6 +1319,7 @@
1288
1319
  - Add after unlock hook [\#92](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/92) ([HParker](https://github.com/HParker))
1289
1320
  - Do not unlock on sidekiq shutdown [\#87](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/87) ([deltaroe](https://github.com/deltaroe))
1290
1321
  - Remove no-op code, protect global space from test code [\#86](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/86) ([stevenjonescgm](https://github.com/stevenjonescgm))
1322
+ - Remove unique lock when executing and clearing jobs in sidekiq fake mode [\#83](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/83) ([crberube](https://github.com/crberube))
1291
1323
  - Fix tests. Tests with latest sidekiq versions and ruby versions [\#82](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/82) ([simonoff](https://github.com/simonoff))
1292
1324
  - Duplicate Payload logging configuration [\#81](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/81) ([jprincipe](https://github.com/jprincipe))
1293
1325
  - output log if not unique [\#79](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/79) ([sonots](https://github.com/sonots))
@@ -1334,7 +1366,6 @@
1334
1366
 
1335
1367
  **Merged pull requests:**
1336
1368
 
1337
- - Remove unique lock when executing and clearing jobs in sidekiq fake mode [\#83](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/83) ([crberube](https://github.com/crberube))
1338
1369
  - Refactoring connectors to use them in client and server [\#56](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/56) ([salrepe](https://github.com/salrepe))
1339
1370
  - Fix dependency error in inline testing connector [\#54](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/54) ([salrepe](https://github.com/salrepe))
1340
1371
  - Add extension to Sidekiq API that is uniqueness-aware [\#52](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/52) ([rickenharp](https://github.com/rickenharp))
data/README.md CHANGED
@@ -98,21 +98,23 @@ bundle
98
98
 
99
99
  Before v7, the middleware was configured automatically. Since some people reported issues with other gems (see [Other Sidekiq Gems](#other-sidekiq-gems)) it was decided to give full control over to the user.
100
100
 
101
+ *NOTE* if you want to use the reaper you also need to configure the server middleware.
102
+
101
103
  [A full and hopefully working example](https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/myapp/config/sidekiq.rb#L12)
102
104
 
103
105
  ```ruby
104
106
  Sidekiq.configure_server do |config|
105
107
  config.redis = { url: ENV["REDIS_URL"], driver: :hiredis }
106
108
 
109
+ config.client_middleware do |chain|
110
+ chain.add SidekiqUniqueJobs::Middleware::Client
111
+ end
112
+
107
113
  config.server_middleware do |chain|
108
114
  chain.add SidekiqUniqueJobs::Middleware::Server
109
115
  end
110
116
 
111
- config.error_handlers << ->(ex, ctx_hash) { p ex, ctx_hash }
112
- config.death_handlers << lambda do |job, _ex|
113
- digest = job["lock_digest"]
114
- SidekiqUniqueJobs::Digests.delete_by_digest(digest) if digest
115
- end
117
+ SidekiqUniqueJobs::Server.configure(config)
116
118
  end
117
119
 
118
120
  Sidekiq.configure_client do |config|
@@ -158,12 +160,12 @@ Want to show me some ❤️ for the hard work I do on this gem? You can use the
158
160
 
159
161
  ## Requirements
160
162
 
161
- - Sidekiq `>= 4.0` (`>= 5.2` recommended)
163
+ - Sidekiq `>= 5.0` (`>= 5.2` recommended)
162
164
  - Ruby:
163
165
  - MRI `>= 2.5` (`>= 2.6` recommended)
164
166
  - JRuby `>= 9.0` (`>= 9.2` recommended)
165
167
  - Truffleruby
166
- - Redis Server `>= 3.0.2` (`>= 3.2` recommended)
168
+ - Redis Server `>= 3.2` (`>= 5.0` recommended)
167
169
  - [ActiveJob officially not supported][48]
168
170
  - [redis-namespace officially not supported][49]
169
171
 
@@ -507,7 +509,7 @@ The last one is log which can be be used with the lock `UntilExecuted` and `Unti
507
509
  It is possible for locks to have different conflict strategy for the client and server. This is useful for `:until_and_while_executing`.
508
510
 
509
511
  ```ruby
510
- sidekiq_options lock: :until_and_while_executing,
512
+ sidekiq_options lock: :until_and_while_executing,
511
513
  on_conflict: { client: :log, server: :reject }
512
514
  ```
513
515
 
@@ -751,8 +753,8 @@ Sidekiq.client_middleware do |chain|
751
753
  end
752
754
 
753
755
  Sidekiq.server_middleware do |chain|
754
- chain.add SidekiqUniqueJobs::Middleware::Server
755
756
  chain.add Sidekiq::GlobalId::ServerMiddleware
757
+ chain.add SidekiqUniqueJobs::Middleware::Server
756
758
  end
757
759
  ```
758
760
 
@@ -765,12 +767,12 @@ It was reported in [#564](https://github.com/mhenrixon/sidekiq-unique-jobs/issue
765
767
  ```ruby
766
768
  Sidekiq.client_middleware do |chain|
767
769
  chain.add Sidekiq::Status::ClientMiddleware, expiration: 10.minutes
768
- chain.add Sidekiq::Status::ServerMiddleware
770
+ chain.add SidekiqUniqueJobs::Middleware::Client
769
771
  end
770
772
 
771
773
  Sidekiq.server_middleware do |chain|
772
- chain.add Sidekiq::Status::ServerMiddleware, expiration: 10.minutes
773
774
  chain.add SidekiqUniqueJobs::Middleware::Server
775
+ chain.add Sidekiq::Status::ServerMiddleware, expiration: 10.minutes
774
776
  end
775
777
  ```
776
778
 
@@ -845,7 +847,6 @@ If you are not using RSpec (a lot of people prefer minitest or test unit) you ca
845
847
  assert SidekiqUniqueJobs.validate_worker!(BadWorker.get_sidekiq_options)
846
848
  ```
847
849
 
848
-
849
850
  ### Uniqueness
850
851
 
851
852
  This has been probably the most confusing part of this gem. People get really confused with how unreliable the unique jobs have been. I there for decided to do what Mike is doing for sidekiq enterprise. Read the section about unique jobs: [Enterprise unique jobs][]
@@ -71,3 +71,4 @@ require "sidekiq_unique_jobs/config"
71
71
  require "sidekiq_unique_jobs/sidekiq_unique_jobs"
72
72
  require "sidekiq_unique_jobs/update_version"
73
73
  require "sidekiq_unique_jobs/upgrade_locks"
74
+ require "sidekiq_unique_jobs/server"
@@ -7,6 +7,13 @@ module SidekiqUniqueJobs
7
7
  # @author Mikael Henriksson <mikael@mhenrixon.com>
8
8
  #
9
9
  class Changelog < Redis::SortedSet
10
+ #
11
+ # @return [Integer] the number of matches to return by default
12
+ DEFAULT_COUNT = 1_000
13
+ #
14
+ # @return [String] the default pattern to use for matching
15
+ SCAN_PATTERN = "*"
16
+
10
17
  def initialize
11
18
  super(CHANGELOGS)
12
19
  end
@@ -34,10 +41,10 @@ module SidekiqUniqueJobs
34
41
  #
35
42
  # @return [Array<Hash>] an array of entries
36
43
  #
37
- def entries(pattern: "*", count: nil)
44
+ def entries(pattern: SCAN_PATTERN, count: DEFAULT_COUNT)
38
45
  options = {}
39
46
  options[:match] = pattern
40
- options[:count] = count if count
47
+ options[:count] = count
41
48
 
42
49
  redis do |conn|
43
50
  conn.zscan_each(key, **options).to_a.map { |entry| load_json(entry[0]) }
@@ -53,7 +60,7 @@ module SidekiqUniqueJobs
53
60
  #
54
61
  # @return [Array<Integer, Integer, Array<Hash>] the total size, next cursor and changelog entries
55
62
  #
56
- def page(cursor, pattern: "*", page_size: 100)
63
+ def page(cursor: 0, pattern: "*", page_size: 100)
57
64
  redis do |conn|
58
65
  total_size, result = conn.multi do
59
66
  conn.zcard(key)
@@ -59,12 +59,7 @@ module SidekiqUniqueJobs
59
59
  # @return [<type>] <description>
60
60
  #
61
61
  def task
62
- @task ||= Concurrent::TimerTask.new(timer_task_options, &task_body)
63
- end
64
-
65
- # @private
66
- def task_body
67
- @task_body ||= lambda do
62
+ @task ||= Concurrent::TimerTask.new(timer_task_options) do
68
63
  with_logging_context do
69
64
  redis do |conn|
70
65
  refresh_reaper_mutex
@@ -23,6 +23,23 @@ module SidekiqUniqueJobs
23
23
  entrys.each_with_object({}) { |pair, hash| hash[pair[0]] = pair[1] }
24
24
  end
25
25
 
26
+ #
27
+ # Adds a value to the sorted set
28
+ #
29
+ # @param [Array<Float, String>, String] the values to add
30
+ #
31
+ # @return [Boolean, Integer] <description>
32
+ #
33
+ def add(values)
34
+ redis do |conn|
35
+ if values.is_a?(Array)
36
+ conn.zadd(key, values)
37
+ else
38
+ conn.zadd(key, now_f, values)
39
+ end
40
+ end
41
+ end
42
+
26
43
  #
27
44
  # Return the zrak of the member
28
45
  #
@@ -45,6 +62,16 @@ module SidekiqUniqueJobs
45
62
  redis { |conn| conn.zscore(key, member) }
46
63
  end
47
64
 
65
+ #
66
+ # Clears the sorted set from all entries
67
+ #
68
+ #
69
+ # @return [Integer] number of entries removed
70
+ #
71
+ def clear
72
+ redis { |conn| conn.zremrangebyrank(key, 0, count) }
73
+ end
74
+
48
75
  #
49
76
  # Returns the count for this sorted set
50
77
  #
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SidekiqUniqueJobs
4
+ # The unique sidekiq middleware for the server processor
5
+ #
6
+ # @author Mikael Henriksson <mikael@mhenrixon.com>
7
+ class Server
8
+ DEATH_HANDLER ||= (lambda do |job, _ex|
9
+ return unless (digest = job["lock_digest"])
10
+
11
+ SidekiqUniqueJobs::Digests.new.delete_by_digest(digest)
12
+ end).freeze
13
+ #
14
+ # Configure the server middleware
15
+ #
16
+ #
17
+ # @return [Sidekiq] the sidekiq configuration
18
+ #
19
+ def self.configure(config)
20
+ config.on(:startup) { start }
21
+ config.on(:shutdown) { stop }
22
+
23
+ return unless config.respond_to?(:death_handlers)
24
+
25
+ config.death_handlers << death_handler
26
+ end
27
+
28
+ def self.start
29
+ SidekiqUniqueJobs::UpdateVersion.call
30
+ SidekiqUniqueJobs::UpgradeLocks.call
31
+ SidekiqUniqueJobs::Orphans::Manager.start
32
+ end
33
+
34
+ def self.stop
35
+ SidekiqUniqueJobs::Orphans::Manager.stop
36
+ end
37
+
38
+ #
39
+ # A death handler for dead jobs
40
+ #
41
+ #
42
+ # @return [lambda]
43
+ #
44
+ def self.death_handler
45
+ DEATH_HANDLER
46
+ end
47
+ end
48
+ end
@@ -3,5 +3,5 @@
3
3
  module SidekiqUniqueJobs
4
4
  #
5
5
  # @return [String] the current SidekiqUniqueJobs version
6
- VERSION = "7.0.0"
6
+ VERSION = "7.0.1"
7
7
  end
@@ -13,6 +13,23 @@ module SidekiqUniqueJobs
13
13
  include Web::Helpers
14
14
  end
15
15
 
16
+ app.get "/changelogs" do
17
+ @filter = params[:filter] || "*"
18
+ @filter = "*" if @filter == ""
19
+ @count = (params[:count] || 100).to_i
20
+ @current_cursor = params[:cursor]
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)
24
+
25
+ erb(unique_template(:changelogs))
26
+ end
27
+
28
+ app.get "/changelogs/delete_all" do
29
+ changelog.clear
30
+ redirect_to :changelogs
31
+ end
32
+
16
33
  app.get "/locks" do
17
34
  @filter = params[:filter] || "*"
18
35
  @filter = "*" if @filter == ""
@@ -58,7 +75,8 @@ begin
58
75
  require "sidekiq/web" unless defined?(Sidekiq::Web)
59
76
 
60
77
  Sidekiq::Web.register(SidekiqUniqueJobs::Web)
61
- Sidekiq::Web.tabs["Locks"] = "locks"
78
+ Sidekiq::Web.tabs["Locks"] = "locks"
79
+ Sidekiq::Web.tabs["Changelogs"] = "changelogs"
62
80
  Sidekiq::Web.settings.locales << File.join(File.dirname(__FILE__), "locales")
63
81
  rescue NameError, LoadError => ex
64
82
  SidekiqUniqueJobs.logger.error(ex)
@@ -10,12 +10,12 @@ module SidekiqUniqueJobs
10
10
  module Helpers
11
11
  #
12
12
  # @return [String] the path to gem specific views
13
- VIEW_PATH = File.expand_path("../web/views", __dir__)
13
+ VIEW_PATH = File.expand_path("../web/views", __dir__).freeze
14
14
  #
15
15
  # @return [Array<String>] safe params
16
16
  SAFE_CPARAMS = %w[cursor prev_cursor].freeze
17
17
 
18
- module_function
18
+ extend self
19
19
 
20
20
  #
21
21
  # Opens a template file contained within this gem
@@ -25,7 +25,18 @@ module SidekiqUniqueJobs
25
25
  # @return [String] the file contents of the template
26
26
  #
27
27
  def unique_template(name)
28
- File.open(File.join(VIEW_PATH, "#{name}.erb")).read
28
+ File.open(unique_filename(name)).read
29
+ end
30
+
31
+ #
32
+ # Construct template file name
33
+ #
34
+ # @param [Symbol] name the name of the template
35
+ #
36
+ # @return [String] the full name of the file
37
+ #
38
+ def unique_filename(name)
39
+ File.join(VIEW_PATH, "#{name}.erb")
29
40
  end
30
41
 
31
42
  #
@@ -38,6 +49,16 @@ module SidekiqUniqueJobs
38
49
  @digests ||= SidekiqUniqueJobs::Digests.new
39
50
  end
40
51
 
52
+ #
53
+ # The collection of changelog entries
54
+ #
55
+ #
56
+ # @return [SidekiqUniqueJobs::Digests] the sorted set with digests
57
+ #
58
+ def changelog
59
+ @changelog ||= SidekiqUniqueJobs::Changelog.new
60
+ end
61
+
41
62
  #
42
63
  # Creates url safe parameters
43
64
  #
@@ -0,0 +1,54 @@
1
+ <header class="row">
2
+ <div class="col-sm-5">
3
+ <h3>
4
+ <%= t('Changelog Entries') %>
5
+ </h3>
6
+ </div>
7
+ <form action="<%= root_path %>changelogs" class="form form-inline" method="get">
8
+ <%= csrf_tag %>
9
+ <input name="filter" class="form-control" type="text" value="<%= @filter %>" />
10
+ <button class="btn btn-default" type="submit">
11
+ <%= t('Filter') %>
12
+ </button>
13
+ </form>
14
+ <% if @changelogs.any? && @total_size > @count.to_i %>
15
+ <div class="col-sm-4">
16
+ <%= erb unique_template(:_paging), locals: { url: "#{root_path}changelogs" } %>
17
+ </div>
18
+ <% end %>
19
+ </header>
20
+ <% if @changelogs.any? %>
21
+ <div class="table_container">
22
+ <form action="<%= root_path %>changelogs/delete_all" method="get">
23
+ <input class="btn btn-danger btn-xs" type="submit" name="delete_all" value="<%= t('DeleteAll') %>" data-confirm="<%= t('AreYouSure') %>" />
24
+ </form>
25
+ <br/>
26
+ <table class="table table-striped table-bordered table-hover">
27
+ <thead>
28
+ <tr>
29
+ <th><%= t('Time') %></th>
30
+ <th><%= t('Digest') %></th>
31
+ <th><%= t('Script') %></th>
32
+ <th><%= t('JID') %></th>
33
+ <th><%= t('Prev JID') %></th>
34
+ <th><%= t('Message') %></th>
35
+ </tr>
36
+ </thead>
37
+ <tbody>
38
+ <% @changelogs.each do |changelog| %>
39
+ <tr>
40
+ <td><%= safe_relative_time(changelog["time"]) %></td>
41
+ <td><%= changelog["digest"] %></td>
42
+ <td><%= changelog["script"] %></td>
43
+ <td><%= changelog["job_id"] %></td>
44
+ <td><%= changelog["prev_jid"] %></td>
45
+ <td><%= changelog["message"] %></th>
46
+ </tr>
47
+ <% end %>
48
+ </tbody>
49
+ </table>
50
+ <form action="<%= root_path %>changelogs/delete_all" method="get">
51
+ <input class="btn btn-danger btn-xs" type="submit" name="delete_all" value="<%= t('DeleteAll') %>" data-confirm="<%= t('AreYouSure') %>" />
52
+ </form>
53
+ </div>
54
+ <% end %>
@@ -32,7 +32,7 @@
32
32
  <% @locks.each do |lock| %>
33
33
  <tr>
34
34
  <td>
35
- <form action="<%= root_path %>locks/<%= lock.key %>" method="get">
35
+ <form action="<%= root_path %>locks/<%= lock.key %>/delete" method="get">
36
36
  <%= csrf_tag %>
37
37
  <input name="lock" value="<%= h lock.key %>" type="hidden" />
38
38
  <input class="btn btn-danger btn-xs" type="submit" name="delete" value="<%= t('Delete') %>" 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.0
4
+ version: 7.0.1
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-01-20 00:00:00.000000000 Z
11
+ date: 2021-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: brpoplpush-redis_script
@@ -188,6 +188,7 @@ files:
188
188
  - lib/sidekiq_unique_jobs/rspec/matchers/have_valid_sidekiq_options.rb
189
189
  - lib/sidekiq_unique_jobs/script.rb
190
190
  - lib/sidekiq_unique_jobs/script/caller.rb
191
+ - lib/sidekiq_unique_jobs/server.rb
191
192
  - lib/sidekiq_unique_jobs/sidekiq_unique_ext.rb
192
193
  - lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb
193
194
  - lib/sidekiq_unique_jobs/sidekiq_worker_methods.rb
@@ -201,6 +202,7 @@ files:
201
202
  - lib/sidekiq_unique_jobs/web.rb
202
203
  - lib/sidekiq_unique_jobs/web/helpers.rb
203
204
  - lib/sidekiq_unique_jobs/web/views/_paging.erb
205
+ - lib/sidekiq_unique_jobs/web/views/changelogs.erb
204
206
  - lib/sidekiq_unique_jobs/web/views/lock.erb
205
207
  - lib/sidekiq_unique_jobs/web/views/locks.erb
206
208
  - lib/tasks/changelog.rake