sidekiq-unique-jobs 7.1.12 → 7.1.13
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 +9 -0
- data/README.md +1 -1
- data/lib/sidekiq_unique_jobs/changelog.rb +3 -3
- data/lib/sidekiq_unique_jobs/digests.rb +3 -3
- data/lib/sidekiq_unique_jobs/lock.rb +6 -6
- data/lib/sidekiq_unique_jobs/sidekiq_unique_ext.rb +1 -1
- data/lib/sidekiq_unique_jobs/sidekiq_worker_methods.rb +13 -3
- data/lib/sidekiq_unique_jobs/timing.rb +1 -1
- data/lib/sidekiq_unique_jobs/version.rb +1 -1
- data/lib/sidekiq_unique_jobs/web/helpers.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd2a8c713ad1593ff340793f2cbd1d07427bbb239d3efd4cc810489f99801e8b
|
4
|
+
data.tar.gz: e33006dc4b63292e1e8cf7576d7c80d59ee077dfea852d6dbb7230afa52ed116
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0a410cd505b3ccf292ded829328fa78f7250f42a350709e88d220f2ce5ec73e7f93d7c6c6adaab7fc0ffb0c28314e3ba3ce6b6e96c02918c9a6f2d908cf31d0
|
7
|
+
data.tar.gz: 6fbbb12c4db8a91a29c5baf6cc96b208576074744d417649191b26bccc7b8069ceeddd178ecf864c5028fc35744700c7ffdf621f0a2cc8669d79c4f675a1ac54
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [v7.1.12](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.1.12) (2021-12-01)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.1.11...v7.1.12)
|
6
|
+
|
7
|
+
**Implemented enhancements:**
|
8
|
+
|
9
|
+
- Improve Ruby Reaper performance under heavy load [\#663](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/663)
|
10
|
+
- Improve reaper performance under heavy load [\#666](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/666) ([mhenrixon](https://github.com/mhenrixon))
|
11
|
+
|
3
12
|
## [v7.1.11](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.1.11) (2021-11-30)
|
4
13
|
|
5
14
|
[Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.1.10...v7.1.11)
|
data/README.md
CHANGED
@@ -599,7 +599,7 @@ Expected BadWorker to have valid sidekiq options but found the following problem
|
|
599
599
|
If you are not using RSpec (a lot of people prefer minitest or test unit) you can do something like:
|
600
600
|
|
601
601
|
```ruby
|
602
|
-
|
602
|
+
assert_raise(InvalidWorker){ SidekiqUniqueJobs.validate_worker!(BadWorker.get_sidekiq_options) }
|
603
603
|
```
|
604
604
|
|
605
605
|
### Uniqueness
|
@@ -62,9 +62,9 @@ module SidekiqUniqueJobs
|
|
62
62
|
#
|
63
63
|
def page(cursor: 0, pattern: "*", page_size: 100)
|
64
64
|
redis do |conn|
|
65
|
-
total_size, result = conn.multi do
|
66
|
-
|
67
|
-
|
65
|
+
total_size, result = conn.multi do |pipeline|
|
66
|
+
pipeline.zcard(key)
|
67
|
+
pipeline.zscan(key, cursor, match: pattern, count: page_size)
|
68
68
|
end
|
69
69
|
|
70
70
|
[
|
@@ -95,9 +95,9 @@ module SidekiqUniqueJobs
|
|
95
95
|
#
|
96
96
|
def page(cursor: 0, pattern: SCAN_PATTERN, page_size: 100)
|
97
97
|
redis do |conn|
|
98
|
-
total_size, digests = conn.multi do
|
99
|
-
|
100
|
-
|
98
|
+
total_size, digests = conn.multi do |pipeline|
|
99
|
+
pipeline.zcard(key)
|
100
|
+
pipeline.zscan(key, cursor, match: pattern, count: page_size)
|
101
101
|
end
|
102
102
|
|
103
103
|
[
|
@@ -62,13 +62,13 @@ module SidekiqUniqueJobs
|
|
62
62
|
#
|
63
63
|
def lock(job_id, lock_info = {})
|
64
64
|
redis do |conn|
|
65
|
-
conn.multi do
|
66
|
-
|
67
|
-
|
65
|
+
conn.multi do |pipeline|
|
66
|
+
pipeline.set(key.digest, job_id)
|
67
|
+
pipeline.hset(key.locked, job_id, now_f)
|
68
68
|
info.set(lock_info)
|
69
|
-
|
70
|
-
|
71
|
-
|
69
|
+
pipeline.zadd(key.digests, now_f, key.digest)
|
70
|
+
pipeline.zadd(key.changelog, now_f, changelog_json(job_id, "queue.lua", "Queued"))
|
71
|
+
pipeline.zadd(key.changelog, now_f, changelog_json(job_id, "lock.lua", "Locked"))
|
72
72
|
end
|
73
73
|
end
|
74
74
|
end
|
@@ -34,12 +34,22 @@ module SidekiqUniqueJobs
|
|
34
34
|
|
35
35
|
# The hook to call after a successful unlock
|
36
36
|
# @return [Proc]
|
37
|
-
def after_unlock_hook
|
37
|
+
def after_unlock_hook # rubocop:disable Metrics/MethodLength
|
38
38
|
lambda do
|
39
39
|
if @worker_class.respond_to?(:after_unlock)
|
40
|
-
|
40
|
+
# instance method in sidekiq v6
|
41
|
+
if @worker_class.method(:after_unlock).arity.positive? # arity check to maintain backwards compatibility
|
42
|
+
@worker_class.after_unlock(item)
|
43
|
+
else
|
44
|
+
@worker_class.after_unlock
|
45
|
+
end
|
41
46
|
elsif worker_class.respond_to?(:after_unlock)
|
42
|
-
|
47
|
+
# class method regardless of sidekiq version
|
48
|
+
if worker_class.method(:after_unlock).arity.positive? # arity check to maintain backwards compatibility
|
49
|
+
worker_class.after_unlock(item)
|
50
|
+
else
|
51
|
+
worker_class.after_unlock
|
52
|
+
end
|
43
53
|
end
|
44
54
|
end
|
45
55
|
end
|
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.1.
|
4
|
+
version: 7.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikael Henriksson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: brpoplpush-redis_script
|
@@ -211,7 +211,7 @@ files:
|
|
211
211
|
- lib/sidekiq_unique_jobs/web/views/lock.erb
|
212
212
|
- lib/sidekiq_unique_jobs/web/views/locks.erb
|
213
213
|
- lib/tasks/changelog.rake
|
214
|
-
homepage: https://
|
214
|
+
homepage: https://github.com/mhenrixon/sidekiq-unique-jobs
|
215
215
|
licenses:
|
216
216
|
- MIT
|
217
217
|
metadata:
|
@@ -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.
|
260
|
+
rubygems_version: 3.3.4
|
261
261
|
signing_key:
|
262
262
|
specification_version: 4
|
263
263
|
summary: Sidekiq middleware that prevents duplicates jobs
|