sidekiq-unique-jobs 7.0.3 → 7.0.8
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 +100 -29
- data/README.md +9 -7
- data/lib/sidekiq_unique_jobs/changelog.rb +2 -2
- data/lib/sidekiq_unique_jobs/digests.rb +2 -2
- data/lib/sidekiq_unique_jobs/lock/base_lock.rb +2 -2
- data/lib/sidekiq_unique_jobs/lock/until_and_while_executing.rb +2 -2
- data/lib/sidekiq_unique_jobs/lock_config.rb +4 -0
- data/lib/sidekiq_unique_jobs/locksmith.rb +9 -7
- data/lib/sidekiq_unique_jobs/logging.rb +31 -11
- data/lib/sidekiq_unique_jobs/lua/shared/_find_digest_in_process_set.lua +1 -1
- data/lib/sidekiq_unique_jobs/orphans/ruby_reaper.rb +14 -2
- data/lib/sidekiq_unique_jobs/redis/entity.rb +7 -1
- data/lib/sidekiq_unique_jobs/sidekiq_unique_jobs.rb +1 -1
- data/lib/sidekiq_unique_jobs/timer_task.rb +1 -1
- data/lib/sidekiq_unique_jobs/version.rb +1 -1
- data/lib/sidekiq_unique_jobs/web.rb +11 -4
- data/lib/sidekiq_unique_jobs/web/helpers.rb +5 -5
- data/lib/sidekiq_unique_jobs/web/views/_paging.erb +4 -4
- data/lib/sidekiq_unique_jobs/web/views/changelogs.erb +1 -1
- data/lib/sidekiq_unique_jobs/web/views/locks.erb +17 -15
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18209b6ac653199d4f9f364b3f5505967c602a9c44f58476df4e7b67fbcb9cb3
|
4
|
+
data.tar.gz: 6d324f341cdb90d12e7f462134d5db8f6a51426c647a5437d1100b4614d1ff22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4ff3f53cf3c5c5f0739c14f1f53728de4864c7c79038d41345f4cfa3532548aae0a0cd01ae39d2a2bfd79f93dcfef617bde4c2470f9507c0cb541e7cf8cf5c9
|
7
|
+
data.tar.gz: 1170777058fa0724bd9ebca5f3e5f8e9e14a1733976e481052056523236923112b5df35b526c50777bb07344833954beac3748406327b69372168b9b36216202
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,64 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [v7.0.7](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.7) (2021-03-19)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.6...v7.0.7)
|
6
|
+
|
7
|
+
**Fixed bugs:**
|
8
|
+
|
9
|
+
- Web filter param not working in pagination [\#584](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/584) ([mhenrixon](https://github.com/mhenrixon))
|
10
|
+
|
11
|
+
## [v7.0.6](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.6) (2021-03-19)
|
12
|
+
|
13
|
+
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.5...v7.0.6)
|
14
|
+
|
15
|
+
**Fixed bugs:**
|
16
|
+
|
17
|
+
- Deprecation warning for redis behaviour change in 5.0 [\#579](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/579)
|
18
|
+
- Consider a match only when both values present [\#586](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/586) ([mhenrixon](https://github.com/mhenrixon))
|
19
|
+
|
20
|
+
**Closed issues:**
|
21
|
+
|
22
|
+
- Reaper: undefined method `delete\_suffix' for nil:NilClass [\#585](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/585)
|
23
|
+
|
24
|
+
## [v7.0.5](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.5) (2021-03-18)
|
25
|
+
|
26
|
+
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.4...v7.0.5)
|
27
|
+
|
28
|
+
**Implemented enhancements:**
|
29
|
+
|
30
|
+
- Improve compatibility with redis-namespace [\#581](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/581) ([Wolfer](https://github.com/Wolfer))
|
31
|
+
|
32
|
+
**Fixed bugs:**
|
33
|
+
|
34
|
+
- RubyReaper treats runtime lock as orphan and delete it [\#580](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/580)
|
35
|
+
- Prefer conn.exists? when possible [\#583](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/583) ([mhenrixon](https://github.com/mhenrixon))
|
36
|
+
- Don't reap :RUN keys when active [\#582](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/582) ([mhenrixon](https://github.com/mhenrixon))
|
37
|
+
|
38
|
+
**Closed issues:**
|
39
|
+
|
40
|
+
- redis-namespace asks to use admistrative commands directly [\#578](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/578)
|
41
|
+
|
42
|
+
## [v7.0.4](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.4) (2021-02-17)
|
43
|
+
|
44
|
+
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.3...v7.0.4)
|
45
|
+
|
46
|
+
**Fixed bugs:**
|
47
|
+
|
48
|
+
- Fix uninitialized scheduled task [\#577](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/577) ([ArturT](https://github.com/ArturT))
|
49
|
+
|
50
|
+
## [v7.0.3](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.3) (2021-02-17)
|
51
|
+
|
52
|
+
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.2...v7.0.3)
|
53
|
+
|
54
|
+
**Fixed bugs:**
|
55
|
+
|
56
|
+
- Reduce reaper threads [\#576](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/576) ([mhenrixon](https://github.com/mhenrixon))
|
57
|
+
|
58
|
+
**Merged pull requests:**
|
59
|
+
|
60
|
+
- Fix typo in README.md \[ci skip\] [\#575](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/575) ([yujideveloper](https://github.com/yujideveloper))
|
61
|
+
|
3
62
|
## [v7.0.2](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.2) (2021-02-08)
|
4
63
|
|
5
64
|
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.1...v7.0.2)
|
@@ -44,7 +103,6 @@
|
|
44
103
|
**Fixed bugs:**
|
45
104
|
|
46
105
|
- Fix configuration [\#570](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/570) ([mhenrixon](https://github.com/mhenrixon))
|
47
|
-
- Prefer lock\_prefix not unique\_prefix [\#554](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/554) ([mhenrixon](https://github.com/mhenrixon))
|
48
106
|
|
49
107
|
**Closed issues:**
|
50
108
|
|
@@ -78,7 +136,6 @@
|
|
78
136
|
|
79
137
|
- Ruby Reaper active check incorrect [\#557](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/557)
|
80
138
|
- Routes with authentication should work with web [\#562](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/562) ([mhenrixon](https://github.com/mhenrixon))
|
81
|
-
- Fix active check for the worker hash [\#558](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/558) ([mhenrixon](https://github.com/mhenrixon))
|
82
139
|
|
83
140
|
**Closed issues:**
|
84
141
|
|
@@ -92,6 +149,8 @@
|
|
92
149
|
|
93
150
|
- 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)
|
94
151
|
- incorrect `:while\_executing` behavior [\#432](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/432)
|
152
|
+
- Fix active check for the worker hash [\#558](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/558) ([mhenrixon](https://github.com/mhenrixon))
|
153
|
+
- Prefer lock\_prefix not unique\_prefix [\#554](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/554) ([mhenrixon](https://github.com/mhenrixon))
|
95
154
|
- Fix issue 432 [\#552](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/552) ([mhenrixon](https://github.com/mhenrixon))
|
96
155
|
|
97
156
|
## [v7.0.0.beta27](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta27) (2020-11-03)
|
@@ -105,7 +164,6 @@
|
|
105
164
|
**Fixed bugs:**
|
106
165
|
|
107
166
|
- Rename lock\_args to lock\_args\_method [\#551](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/551) ([mhenrixon](https://github.com/mhenrixon))
|
108
|
-
- Fix RubyReaper active? [\#538](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/538) ([tanner-rutgers](https://github.com/tanner-rutgers))
|
109
167
|
|
110
168
|
**Closed issues:**
|
111
169
|
|
@@ -120,7 +178,6 @@
|
|
120
178
|
|
121
179
|
- How to disable Reaper [\#543](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/543)
|
122
180
|
- Allow disabling of reaper [\#544](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/544) ([mhenrixon](https://github.com/mhenrixon))
|
123
|
-
- Bump rubocop [\#539](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/539) ([mhenrixon](https://github.com/mhenrixon))
|
124
181
|
|
125
182
|
**Merged pull requests:**
|
126
183
|
|
@@ -139,9 +196,14 @@
|
|
139
196
|
|
140
197
|
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta24...v7.0.0.beta25)
|
141
198
|
|
199
|
+
**Implemented enhancements:**
|
200
|
+
|
201
|
+
- Bump rubocop [\#539](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/539) ([mhenrixon](https://github.com/mhenrixon))
|
202
|
+
|
142
203
|
**Fixed bugs:**
|
143
204
|
|
144
205
|
- Ruby reaper not working, active jobs queried incorrectly [\#537](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/537)
|
206
|
+
- Fix RubyReaper active? [\#538](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/538) ([tanner-rutgers](https://github.com/tanner-rutgers))
|
145
207
|
|
146
208
|
**Closed issues:**
|
147
209
|
|
@@ -167,10 +229,6 @@
|
|
167
229
|
|
168
230
|
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.23...v7.0.0.beta23)
|
169
231
|
|
170
|
-
**Fixed bugs:**
|
171
|
-
|
172
|
-
- Exit early when no results are returned from LRANGE given jobs might already processed [\#521](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/521) ([vipulnsward](https://github.com/vipulnsward))
|
173
|
-
|
174
232
|
## [v6.0.23](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.23) (2020-06-23)
|
175
233
|
|
176
234
|
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.0.beta22...v6.0.23)
|
@@ -200,6 +258,7 @@
|
|
200
258
|
|
201
259
|
**Fixed bugs:**
|
202
260
|
|
261
|
+
- Exit early when no results are returned from LRANGE given jobs might already processed [\#521](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/521) ([vipulnsward](https://github.com/vipulnsward))
|
203
262
|
- Prevent indefinitely looping entries [\#516](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/516) ([mhenrixon](https://github.com/mhenrixon))
|
204
263
|
|
205
264
|
**Closed issues:**
|
@@ -252,9 +311,7 @@
|
|
252
311
|
|
253
312
|
**Fixed bugs:**
|
254
313
|
|
255
|
-
- Deprecate configuration options with `default\_` [\#504](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/504) ([mhenrixon](https://github.com/mhenrixon))
|
256
314
|
- Fix access to both server and client conflict [\#503](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/503) ([mhenrixon](https://github.com/mhenrixon))
|
257
|
-
- Prevent reaping of active jobs [\#493](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/493) ([mhenrixon](https://github.com/mhenrixon))
|
258
315
|
|
259
316
|
**Closed issues:**
|
260
317
|
|
@@ -283,8 +340,10 @@
|
|
283
340
|
- Brpoplpush::RedisScript::LuaError: WRONGTYPE Operation against a key holding the wrong kind of value [\#491](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/491)
|
284
341
|
- Lua script bug [\#489](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/489)
|
285
342
|
- Reaper will delete locks for running jobs [\#488](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/488)
|
343
|
+
- Deprecate configuration options with `default\_` [\#504](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/504) ([mhenrixon](https://github.com/mhenrixon))
|
286
344
|
- Fix access to hash members [\#496](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/496) ([mhenrixon](https://github.com/mhenrixon))
|
287
345
|
- Fix cursor assignment [\#494](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/494) ([mhenrixon](https://github.com/mhenrixon))
|
346
|
+
- Prevent reaping of active jobs [\#493](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/493) ([mhenrixon](https://github.com/mhenrixon))
|
288
347
|
|
289
348
|
## [v7.0.0.beta14](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta14) (2020-03-30)
|
290
349
|
|
@@ -309,6 +368,7 @@
|
|
309
368
|
**Fixed bugs:**
|
310
369
|
|
311
370
|
- Remove digest deletion for concurrent locks [\#482](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/482) ([mhenrixon](https://github.com/mhenrixon))
|
371
|
+
- Fix bug where expiration wasn't set until unlock [\#481](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/481) ([mhenrixon](https://github.com/mhenrixon))
|
312
372
|
|
313
373
|
## [v7.0.0.beta12](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.0.beta12) (2020-03-25)
|
314
374
|
|
@@ -317,7 +377,6 @@
|
|
317
377
|
**Fixed bugs:**
|
318
378
|
|
319
379
|
- until\_expired is not setting TTL [\#468](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/468)
|
320
|
-
- Fix bug where expiration wasn't set until unlock [\#481](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/481) ([mhenrixon](https://github.com/mhenrixon))
|
321
380
|
|
322
381
|
## [v6.0.20](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.20) (2020-03-22)
|
323
382
|
|
@@ -353,6 +412,8 @@
|
|
353
412
|
- Rename remaining unique\_\* keys to lock\_\* [\#475](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/475) ([mhenrixon](https://github.com/mhenrixon))
|
354
413
|
- Split calculator into two separate [\#474](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/474) ([mhenrixon](https://github.com/mhenrixon))
|
355
414
|
- Prepare for improving tests [\#473](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/473) ([mhenrixon](https://github.com/mhenrixon))
|
415
|
+
- Update gemspec: thor [\#465](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/465) ([masawo](https://github.com/masawo))
|
416
|
+
- Various changes to test and verify reliability [\#463](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/463) ([mhenrixon](https://github.com/mhenrixon))
|
356
417
|
|
357
418
|
**Fixed bugs:**
|
358
419
|
|
@@ -380,8 +441,6 @@
|
|
380
441
|
**Implemented enhancements:**
|
381
442
|
|
382
443
|
- Keys without TTL [\#417](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/417)
|
383
|
-
- Update gemspec: thor [\#465](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/465) ([masawo](https://github.com/masawo))
|
384
|
-
- Various changes to test and verify reliability [\#463](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/463) ([mhenrixon](https://github.com/mhenrixon))
|
385
444
|
|
386
445
|
**Closed issues:**
|
387
446
|
|
@@ -456,6 +515,7 @@
|
|
456
515
|
- Prevent multiple reapers [\#453](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/453) ([mhenrixon](https://github.com/mhenrixon))
|
457
516
|
- Make deletion compatible with redis-namespace [\#452](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/452) ([mhenrixon](https://github.com/mhenrixon))
|
458
517
|
- Make sure server process stays locked [\#448](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/448) ([mhenrixon](https://github.com/mhenrixon))
|
518
|
+
- Include redis directory [\#430](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/430) ([mhenrixon](https://github.com/mhenrixon))
|
459
519
|
|
460
520
|
**Merged pull requests:**
|
461
521
|
|
@@ -536,8 +596,10 @@
|
|
536
596
|
**Fixed bugs:**
|
537
597
|
|
538
598
|
- Allow Sidekiq::Context to be used for logging [\#429](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/429) ([mhenrixon](https://github.com/mhenrixon))
|
599
|
+
- Fix sidekiq develop [\#426](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/426) ([mhenrixon](https://github.com/mhenrixon))
|
539
600
|
- Reap as many orphans as advertised [\#403](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/403) ([mhenrixon](https://github.com/mhenrixon))
|
540
601
|
- Reaper should remove :INFO keys [\#399](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/399) ([mhenrixon](https://github.com/mhenrixon))
|
602
|
+
- Fix converting legacy locks [\#378](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/378) ([mhenrixon](https://github.com/mhenrixon))
|
541
603
|
|
542
604
|
**Merged pull requests:**
|
543
605
|
|
@@ -560,9 +622,7 @@
|
|
560
622
|
|
561
623
|
- Duplicate job was pushed \( v6.0.13 \) [\#414](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/414)
|
562
624
|
- Constant SidekiqUniqueJobs::Web::Digests not found [\#396](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/396)
|
563
|
-
- Include redis directory [\#430](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/430) ([mhenrixon](https://github.com/mhenrixon))
|
564
625
|
- Fix v6 [\#428](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/428) ([mhenrixon](https://github.com/mhenrixon))
|
565
|
-
- Fix sidekiq develop [\#426](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/426) ([mhenrixon](https://github.com/mhenrixon))
|
566
626
|
|
567
627
|
**Closed issues:**
|
568
628
|
|
@@ -599,7 +659,6 @@
|
|
599
659
|
**Fixed bugs:**
|
600
660
|
|
601
661
|
- we are receiving SidekiqUniqueJobs::ScriptError "Problem compiling convert\_legacy\_lock" after upgrading from 5.0.10 -\> 6.0.11 [\#377](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/377)
|
602
|
-
- Fix converting legacy locks [\#378](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/378) ([mhenrixon](https://github.com/mhenrixon))
|
603
662
|
|
604
663
|
## [v6.0.11](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.11) (2019-02-24)
|
605
664
|
|
@@ -777,10 +836,18 @@
|
|
777
836
|
- Not unlocking automatically \(version 6.0.0rc5\) [\#293](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/293)
|
778
837
|
- Bug fixes [\#310](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/310) ([mhenrixon](https://github.com/mhenrixon))
|
779
838
|
|
839
|
+
**Merged pull requests:**
|
840
|
+
|
841
|
+
- Update README.md [\#300](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/300) ([pirj](https://github.com/pirj))
|
842
|
+
|
780
843
|
## [v6.0.1](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.1) (2018-07-31)
|
781
844
|
|
782
845
|
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.0...v6.0.1)
|
783
846
|
|
847
|
+
**Implemented enhancements:**
|
848
|
+
|
849
|
+
- Add a replace strategy for client locks [\#302](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/302) ([mhenrixon](https://github.com/mhenrixon))
|
850
|
+
|
784
851
|
**Fixed bugs:**
|
785
852
|
|
786
853
|
- :until\_executed is throwing errors and not requeuing the job. [\#256](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/256)
|
@@ -795,7 +862,6 @@
|
|
795
862
|
|
796
863
|
- Dead jobs [\#308](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/308) ([mhenrixon](https://github.com/mhenrixon))
|
797
864
|
- Fix require path for sidekiq\_unique\_jobs/web [\#305](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/305) ([soundasleep](https://github.com/soundasleep))
|
798
|
-
- Fix README [\#298](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/298) ([mhenrixon](https://github.com/mhenrixon))
|
799
865
|
|
800
866
|
## [v6.0.0](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0) (2018-07-27)
|
801
867
|
|
@@ -809,12 +875,10 @@
|
|
809
875
|
|
810
876
|
- Add RequeueWhileExecuting strategy [\#223](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/223)
|
811
877
|
- New feature: Replace original job if duplicate is added [\#177](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/177)
|
812
|
-
- Add a replace strategy for client locks [\#302](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/302) ([mhenrixon](https://github.com/mhenrixon))
|
813
878
|
|
814
879
|
**Merged pull requests:**
|
815
880
|
|
816
881
|
- Add more details about testing uniqueness [\#301](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/301) ([mhenrixon](https://github.com/mhenrixon))
|
817
|
-
- Update README.md [\#300](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/300) ([pirj](https://github.com/pirj))
|
818
882
|
|
819
883
|
## [v6.0.0.rc7](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0.rc7) (2018-07-23)
|
820
884
|
|
@@ -823,8 +887,13 @@
|
|
823
887
|
**Implemented enhancements:**
|
824
888
|
|
825
889
|
- Sidekiq web [\#297](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/297) ([mhenrixon](https://github.com/mhenrixon))
|
890
|
+
- Document code [\#296](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/296) ([mhenrixon](https://github.com/mhenrixon))
|
826
891
|
- Rename to `unique:` to `lock:` [\#295](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/295) ([mhenrixon](https://github.com/mhenrixon))
|
827
892
|
|
893
|
+
**Fixed bugs:**
|
894
|
+
|
895
|
+
- Rename command line binary [\#287](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/287) ([mhenrixon](https://github.com/mhenrixon))
|
896
|
+
|
828
897
|
**Closed issues:**
|
829
898
|
|
830
899
|
- Unique Job not work while play with crontab [\#294](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/294)
|
@@ -833,7 +902,7 @@
|
|
833
902
|
**Merged pull requests:**
|
834
903
|
|
835
904
|
- Adds changelog entry [\#299](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/299) ([mhenrixon](https://github.com/mhenrixon))
|
836
|
-
-
|
905
|
+
- Fix README [\#298](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/298) ([mhenrixon](https://github.com/mhenrixon))
|
837
906
|
|
838
907
|
## [v6.0.0.rc6](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0.rc6) (2018-07-15)
|
839
908
|
|
@@ -847,6 +916,10 @@
|
|
847
916
|
|
848
917
|
- Locking with retries [\#289](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/289)
|
849
918
|
|
919
|
+
**Merged pull requests:**
|
920
|
+
|
921
|
+
- Readme [\#288](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/288) ([mhenrixon](https://github.com/mhenrixon))
|
922
|
+
|
850
923
|
## [v6.0.0.rc5](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0.rc5) (2018-06-30)
|
851
924
|
|
852
925
|
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v6.0.0.rc4...v6.0.0.rc5)
|
@@ -854,7 +927,6 @@
|
|
854
927
|
**Fixed bugs:**
|
855
928
|
|
856
929
|
- bundle exec jobs console does not work [\#253](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/253)
|
857
|
-
- Rename command line binary [\#287](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/287) ([mhenrixon](https://github.com/mhenrixon))
|
858
930
|
|
859
931
|
## [v6.0.0.rc4](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0.rc4) (2018-06-30)
|
860
932
|
|
@@ -862,7 +934,6 @@
|
|
862
934
|
|
863
935
|
**Implemented enhancements:**
|
864
936
|
|
865
|
-
- Document code [\#296](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/296) ([mhenrixon](https://github.com/mhenrixon))
|
866
937
|
- Prepare for v6 [\#286](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/286) ([mhenrixon](https://github.com/mhenrixon))
|
867
938
|
- Only unlock not delete [\#285](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/285) ([mhenrixon](https://github.com/mhenrixon))
|
868
939
|
|
@@ -909,7 +980,6 @@
|
|
909
980
|
**Implemented enhancements:**
|
910
981
|
|
911
982
|
- Legacy support [\#280](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/280)
|
912
|
-
- Adds legacy support [\#281](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/281) ([mhenrixon](https://github.com/mhenrixon))
|
913
983
|
- Adds guard-reek [\#279](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/279) ([mhenrixon](https://github.com/mhenrixon))
|
914
984
|
- Fix UntilExpired [\#278](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/278) ([mhenrixon](https://github.com/mhenrixon))
|
915
985
|
|
@@ -928,9 +998,11 @@
|
|
928
998
|
|
929
999
|
**Implemented enhancements:**
|
930
1000
|
|
1001
|
+
- Adds legacy support [\#281](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/281) ([mhenrixon](https://github.com/mhenrixon))
|
931
1002
|
- Code smells [\#275](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/275) ([mhenrixon](https://github.com/mhenrixon))
|
932
1003
|
- Reject while scheduling [\#273](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/273) ([mhenrixon](https://github.com/mhenrixon))
|
933
1004
|
- Improve testing [\#272](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/272) ([mhenrixon](https://github.com/mhenrixon))
|
1005
|
+
- Use ruby 2.5.1 [\#267](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/267) ([mhenrixon](https://github.com/mhenrixon))
|
934
1006
|
|
935
1007
|
## [v6.0.0.beta](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v6.0.0.beta) (2018-06-17)
|
936
1008
|
|
@@ -941,7 +1013,6 @@
|
|
941
1013
|
- Until and while executing [\#271](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/271) ([mhenrixon](https://github.com/mhenrixon))
|
942
1014
|
- Solidify master [\#270](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/270) ([mhenrixon](https://github.com/mhenrixon))
|
943
1015
|
- Minor adjustments [\#268](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/268) ([mhenrixon](https://github.com/mhenrixon))
|
944
|
-
- Use ruby 2.5.1 [\#267](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/267) ([mhenrixon](https://github.com/mhenrixon))
|
945
1016
|
- Add explicit concurrent-ruby dependency. [\#265](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/265) ([brettburley](https://github.com/brettburley))
|
946
1017
|
|
947
1018
|
**Fixed bugs:**
|
@@ -981,7 +1052,6 @@
|
|
981
1052
|
|
982
1053
|
- Various improvements [\#240](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/240) ([mhenrixon](https://github.com/mhenrixon))
|
983
1054
|
- Fix: uninitialized constant CustomQueueJob on rspec [\#239](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/239) ([dalpo](https://github.com/dalpo))
|
984
|
-
- Increase sleep delay in WhileExecuting\#synchronize [\#204](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/204) ([dsander](https://github.com/dsander))
|
985
1055
|
|
986
1056
|
## [v5.0.9](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v5.0.9) (2017-07-06)
|
987
1057
|
|
@@ -1098,6 +1168,7 @@
|
|
1098
1168
|
|
1099
1169
|
**Merged pull requests:**
|
1100
1170
|
|
1171
|
+
- Increase sleep delay in WhileExecuting\#synchronize [\#204](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/204) ([dsander](https://github.com/dsander))
|
1101
1172
|
- Ensure job ID removed from uniquejobs hash [\#200](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/200) ([carlosmartinez](https://github.com/carlosmartinez))
|
1102
1173
|
- unique args need to be an array [\#194](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/194) ([pboling](https://github.com/pboling))
|
1103
1174
|
|
@@ -1124,6 +1195,7 @@
|
|
1124
1195
|
- Convert unless if to just 1 if [\#179](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/179) ([otzy007](https://github.com/otzy007))
|
1125
1196
|
- fix for \#168. Handle the NOSCRIPT by sending the script again [\#178](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/178) ([otzy007](https://github.com/otzy007))
|
1126
1197
|
- Fixed gitter badge link [\#176](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/176) ([andrew](https://github.com/andrew))
|
1198
|
+
- Add a Gitter chat badge to README.md [\#166](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/166) ([gitter-badger](https://github.com/gitter-badger))
|
1127
1199
|
|
1128
1200
|
## [v4.0.17](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v4.0.17) (2016-03-02)
|
1129
1201
|
|
@@ -1153,10 +1225,10 @@
|
|
1153
1225
|
- Unique job keys never dissapear [\#161](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/161)
|
1154
1226
|
- Uniqueness breaks jobs [\#160](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/160)
|
1155
1227
|
- Too many open files [\#155](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/155)
|
1228
|
+
- Seeing this error with latest version 4.0.12 [\#154](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/154)
|
1156
1229
|
|
1157
1230
|
**Merged pull requests:**
|
1158
1231
|
|
1159
|
-
- Add a Gitter chat badge to README.md [\#166](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/166) ([gitter-badger](https://github.com/gitter-badger))
|
1160
1232
|
- Fix test overrides. [\#158](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/158) ([benseligman](https://github.com/benseligman))
|
1161
1233
|
- Remove wrong Server::Middleware\#worker\_class override [\#156](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/156) ([vkuznetsov](https://github.com/vkuznetsov))
|
1162
1234
|
|
@@ -1166,7 +1238,6 @@
|
|
1166
1238
|
|
1167
1239
|
**Closed issues:**
|
1168
1240
|
|
1169
|
-
- Seeing this error with latest version 4.0.12 [\#154](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/154)
|
1170
1241
|
- Unique job showing weird behavior [\#153](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/153)
|
1171
1242
|
|
1172
1243
|
## [v4.0.12](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v4.0.12) (2015-12-15)
|
@@ -1441,6 +1512,7 @@
|
|
1441
1512
|
- Lock remains when running with Sidekiq::Testing.inline! [\#23](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/23)
|
1442
1513
|
- What is the use case for the uniqueness window? [\#22](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/22)
|
1443
1514
|
- clarification on unique\_args [\#20](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/20)
|
1515
|
+
- Scheduled Unique Jobs Not Being Enqueued [\#15](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/15)
|
1444
1516
|
- payload\_hash staying around [\#13](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/13)
|
1445
1517
|
|
1446
1518
|
**Merged pull requests:**
|
@@ -1458,7 +1530,6 @@
|
|
1458
1530
|
|
1459
1531
|
- Sidekiq tests failed when sidekiq-unique-jobs is used [\#24](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/24)
|
1460
1532
|
- Redis not mocked in testing [\#18](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/18)
|
1461
|
-
- Scheduled Unique Jobs Not Being Enqueued [\#15](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/15)
|
1462
1533
|
- Retries duplicates unique jobs [\#5](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/5)
|
1463
1534
|
- Middleware not added to chain? [\#2](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/2)
|
1464
1535
|
|
@@ -1470,6 +1541,7 @@
|
|
1470
1541
|
- Compatibility with Sidekiq 2.12.1 Scheduled Jobs [\#16](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/16) ([lsimoneau](https://github.com/lsimoneau))
|
1471
1542
|
- 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))
|
1472
1543
|
- 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))
|
1544
|
+
- Adding the unique prefix option [\#8](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/8) ([KensoDev](https://github.com/KensoDev))
|
1473
1545
|
- Remove unnecessary log messages [\#7](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/7) ([marclennox](https://github.com/marclennox))
|
1474
1546
|
|
1475
1547
|
## [v2.3.2](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v2.3.2) (2012-09-27)
|
@@ -1482,7 +1554,6 @@
|
|
1482
1554
|
|
1483
1555
|
**Merged pull requests:**
|
1484
1556
|
|
1485
|
-
- Adding the unique prefix option [\#8](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/8) ([KensoDev](https://github.com/KensoDev))
|
1486
1557
|
- Fix multiple bugs, cleaned up dependencies, and added a feature [\#4](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/4) ([kemper-blinq](https://github.com/kemper-blinq))
|
1487
1558
|
- Dependency on sidekiq 2.2.0 and up [\#3](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/3) ([philostler](https://github.com/philostler))
|
1488
1559
|
|
data/README.md
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
# SidekiqUniqueJobs
|
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
|
|
@@ -194,7 +196,7 @@ SidekiqUniqueJobs.configure do |config|
|
|
194
196
|
config.reaper = :ruby # :ruby, :lua or :none/nil
|
195
197
|
config.reaper_count = 1000 # Stop reaping after this many keys
|
196
198
|
config.reaper_interval = 600 # Reap orphans every 10 minutes
|
197
|
-
config.reaper_timeout = 150 # Timeout reaper after
|
199
|
+
config.reaper_timeout = 150 # Timeout reaper after 2.5 minutes
|
198
200
|
end
|
199
201
|
```
|
200
202
|
|
@@ -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/
|
909
|
-
- [spec/
|
910
|
-
- [spec/
|
911
|
-
- [spec/
|
912
|
-
- [spec/
|
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
|
|
@@ -124,7 +124,7 @@ module SidekiqUniqueJobs
|
|
124
124
|
attr_reader :attempt
|
125
125
|
|
126
126
|
def unlock_with_callback
|
127
|
-
return log_warn("
|
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("
|
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
|
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
|
@@ -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.
|
202
|
+
.value(drift(config.pttl) / 1000) # Important to reduce time spent waiting
|
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
|
-
|
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
|
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,7 @@ 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.
|
320
|
+
(val.to_f * CLOCK_DRIFT_FACTOR).to_f + 2
|
319
321
|
end
|
320
322
|
|
321
323
|
#
|
@@ -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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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)
|
195
|
+
logger.method(:with_context) if logger_respond_to_with_context?
|
176
196
|
end
|
177
197
|
|
178
198
|
def sidekiq_logging_context_method
|
@@ -27,7 +27,7 @@ local function find_digest_in_process_set(digest, threshold)
|
|
27
27
|
else
|
28
28
|
for i = 1, #jobs, 2 do
|
29
29
|
local jobstr = jobs[i +1]
|
30
|
-
if string.find(jobstr, digest) then
|
30
|
+
if string.find(string.gsub(jobstr, ':RUN', ''), string.gsub(digest, ':RUN', '')) then
|
31
31
|
log_debug("Found digest", digest, "in:", workers_key)
|
32
32
|
found = true
|
33
33
|
break
|
@@ -10,6 +10,7 @@ module SidekiqUniqueJobs
|
|
10
10
|
# @author Mikael Henriksson <mikael@mhenrixon.com>
|
11
11
|
#
|
12
12
|
class RubyReaper < Reaper
|
13
|
+
RUN_SUFFIX = ":RUN"
|
13
14
|
#
|
14
15
|
# @!attribute [r] digests
|
15
16
|
# @return [SidekiqUniqueJobs::Digests] digest collection
|
@@ -124,7 +125,12 @@ module SidekiqUniqueJobs
|
|
124
125
|
|
125
126
|
procs.sort.each do |key|
|
126
127
|
valid, workers = conn.pipelined do
|
127
|
-
|
128
|
+
# TODO: Remove the if statement in the future
|
129
|
+
if conn.respond_to?(:exists?)
|
130
|
+
conn.exists?(key)
|
131
|
+
else
|
132
|
+
conn.exists(key)
|
133
|
+
end
|
128
134
|
conn.hgetall("#{key}:workers")
|
129
135
|
end
|
130
136
|
|
@@ -136,7 +142,7 @@ module SidekiqUniqueJobs
|
|
136
142
|
|
137
143
|
payload = safe_load_json(item[PAYLOAD])
|
138
144
|
|
139
|
-
return true if payload[LOCK_DIGEST]
|
145
|
+
return true if match?(digest, payload[LOCK_DIGEST])
|
140
146
|
return true if considered_active?(payload[CREATED_AT])
|
141
147
|
end
|
142
148
|
end
|
@@ -145,6 +151,12 @@ module SidekiqUniqueJobs
|
|
145
151
|
end
|
146
152
|
end
|
147
153
|
|
154
|
+
def match?(key_one, key_two)
|
155
|
+
return false if key_one.nil? || key_two.nil?
|
156
|
+
|
157
|
+
key_one.delete_suffix(RUN_SUFFIX) == key_two.delete_suffix(RUN_SUFFIX)
|
158
|
+
end
|
159
|
+
|
148
160
|
def considered_active?(time_f)
|
149
161
|
(Time.now - reaper_timeout).to_f < time_f
|
150
162
|
end
|
@@ -47,7 +47,13 @@ module SidekiqUniqueJobs
|
|
47
47
|
#
|
48
48
|
def exist?
|
49
49
|
redis do |conn|
|
50
|
-
|
50
|
+
# TODO: Remove the if statement in the future
|
51
|
+
value =
|
52
|
+
if conn.respond_to?(:exists?)
|
53
|
+
conn.exists?(key)
|
54
|
+
else
|
55
|
+
conn.exists(key)
|
56
|
+
end
|
51
57
|
|
52
58
|
return value if boolean?(value)
|
53
59
|
|
@@ -22,7 +22,7 @@ module SidekiqUniqueJobs
|
|
22
22
|
|
23
23
|
def schedule_next_task(interval = execution_interval)
|
24
24
|
exec_task = ->(completion) { execute_task(completion) }
|
25
|
-
ScheduledTask.execute(interval, args: [Concurrent::Event.new], &exec_task)
|
25
|
+
Concurrent::ScheduledTask.execute(interval, args: [Concurrent::Event.new], &exec_task)
|
26
26
|
nil
|
27
27
|
end
|
28
28
|
|
@@ -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
|
-
@
|
23
|
-
|
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
|
-
|
40
|
-
@total_size, @next_cursor, @locks = digests.page(
|
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[
|
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
|
-
|
71
|
-
|
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
|
-
|
4
|
-
|
5
|
-
|
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>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<%= t('Filter') %>
|
12
12
|
</button>
|
13
13
|
</form>
|
14
|
-
<% if @locks.any? && @total_size > @count
|
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
|
-
<
|
34
|
-
<
|
35
|
-
<
|
36
|
-
<%=
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
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.
|
4
|
+
version: 7.0.8
|
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-04-14 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.
|
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.
|
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.
|
260
|
+
rubygems_version: 3.2.16
|
261
261
|
signing_key:
|
262
262
|
specification_version: 4
|
263
263
|
summary: Sidekiq middleware that prevents duplicates jobs
|