sidekiq-unique-jobs 6.0.23 → 6.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of sidekiq-unique-jobs might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/lib/sidekiq_unique_jobs/sidekiq_worker_methods.rb +7 -1
- data/lib/sidekiq_unique_jobs/version.rb +1 -1
- data/lib/sidekiq_unique_jobs/web.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8ea40e3f79410d8c203d4df254cb6b9b756123b6aacaf15843843c4bd4337c5
|
4
|
+
data.tar.gz: 353ea6c92b0d945ad6571e0c20039c9df7093b74404d05a6e9633447e58827f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c8c527b0a495bcd33672bf02afafadfe0b737394e2e357ca9d40d011ab5e5aaf6c927ae9c67e0bb7b4d2ebbfd43b485fa10e2fec97e3d0523371c3e06f8f1c7
|
7
|
+
data.tar.gz: ba00d25b2f3c6dc5d40cb472de73417c83e4c9c75005cd3339d80e86bb00964f34d8a0ea485e50af2406db025889e901610bc382af00588f82297d0fb16c9d97
|
data/README.md
CHANGED
@@ -344,11 +344,17 @@ If you need to perform any additional work after the lock has been released you
|
|
344
344
|
**Exception 1:** UntilExecuting unlocks and calls back before yielding.
|
345
345
|
**Exception 2:** UntilExpired expires eventually, no after_unlock hook is called.
|
346
346
|
|
347
|
+
**NOTE:** _It is also possible to write this code as a class method._
|
348
|
+
|
347
349
|
```ruby
|
348
350
|
class UniqueJobWithFilterMethod
|
349
351
|
include Sidekiq::Worker
|
350
352
|
sidekiq_options lock: :while_executing,
|
351
353
|
|
354
|
+
def self.after_unlock
|
355
|
+
# block has yielded and lock is released
|
356
|
+
end
|
357
|
+
|
352
358
|
def after_unlock
|
353
359
|
# block has yielded and lock is released
|
354
360
|
end
|
@@ -35,7 +35,13 @@ module SidekiqUniqueJobs
|
|
35
35
|
# The hook to call after a successful unlock
|
36
36
|
# @return [Proc]
|
37
37
|
def after_unlock_hook
|
38
|
-
|
38
|
+
lambda do
|
39
|
+
if @worker_class.respond_to?(:after_unlock)
|
40
|
+
@worker_class.after_unlock # instance method in sidekiq v6
|
41
|
+
elsif worker_class.respond_to?(:after_unlock)
|
42
|
+
worker_class.after_unlock # class method regardless of sidekiq version
|
43
|
+
end
|
44
|
+
end
|
39
45
|
end
|
40
46
|
|
41
47
|
# Attempt to constantize a string worker_class argument, always
|
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: 6.0.
|
4
|
+
version: 6.0.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikael Henriksson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -317,7 +317,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
317
317
|
- !ruby/object:Gem::Version
|
318
318
|
version: '0'
|
319
319
|
requirements: []
|
320
|
-
rubygems_version: 3.1.
|
320
|
+
rubygems_version: 3.1.4
|
321
321
|
signing_key:
|
322
322
|
specification_version: 4
|
323
323
|
summary: Sidekiq middleware that prevents duplicates jobs
|