sidekiq-unique-jobs 6.0.2 → 6.0.3
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/.reek.yml +10 -3
- data/CHANGELOG.md +9 -0
- data/README.md +1 -1
- data/lib/sidekiq_unique_jobs/lock/base_lock.rb +1 -0
- data/lib/sidekiq_unique_jobs/locksmith.rb +1 -1
- data/lib/sidekiq_unique_jobs/on_conflict.rb +1 -0
- data/lib/sidekiq_unique_jobs/on_conflict/replace.rb +1 -1
- data/lib/sidekiq_unique_jobs/util.rb +14 -0
- data/lib/sidekiq_unique_jobs/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e13fe0c30a750cead8f45300cdbe03caa9764e8c84064e411b05fb5eebc34f47
|
4
|
+
data.tar.gz: 8511c7d945ffad30aade383c8b79090f2fdc05f8d0e69673f0fbefd9a8ac6409
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 152c64c9c6e200677efda852adf0db068c1f39031d9975da0d339710ed6d94d78e434960d95a9417df70c859103c8036f9c35f90c3f07973c04ef958c814a8dc
|
7
|
+
data.tar.gz: b9823df969b1432395c29f88ebeb88cc20cea8af6dee1f9364c60574565204c68e63e4fedf0d1a3409f74ab2688aaa9426ab8a2581cdd2ef8962ce0a10a37d45
|
data/.reek.yml
CHANGED
@@ -58,19 +58,26 @@ detectors:
|
|
58
58
|
- Array
|
59
59
|
NilCheck:
|
60
60
|
enabled: false
|
61
|
+
DataClump:
|
62
|
+
enabled: true
|
63
|
+
exclude:
|
64
|
+
- SidekiqUniqueJobs::Util
|
61
65
|
FeatureEnvy:
|
62
66
|
exclude:
|
63
|
-
- SidekiqUniqueJobs::
|
67
|
+
- SidekiqUniqueJobs::Digests#batch_delete
|
68
|
+
- SidekiqUniqueJobs::Digests#page
|
64
69
|
- SidekiqUniqueJobs::Logging#debug_item
|
70
|
+
- SidekiqUniqueJobs::OnConflict::Reject#push_to_deadset
|
65
71
|
- SidekiqUniqueJobs::Util#batch_delete
|
66
|
-
- SidekiqUniqueJobs::
|
72
|
+
- SidekiqUniqueJobs::Web::Helpers#cparams
|
67
73
|
NestedIterators:
|
68
74
|
exclude:
|
75
|
+
- SidekiqUniqueJobs::Digests#batch_delete
|
69
76
|
- SidekiqUniqueJobs::Locksmith#create_lock
|
70
77
|
- SidekiqUniqueJobs::Middleware#configure_client_middleware
|
71
78
|
- SidekiqUniqueJobs::Middleware#configure_server_middleware
|
72
79
|
- SidekiqUniqueJobs::Util#batch_delete
|
73
|
-
- SidekiqUniqueJobs::
|
80
|
+
- SidekiqUniqueJobs::Util#keys_with_ttl
|
74
81
|
TooManyInstanceVariables:
|
75
82
|
exclude:
|
76
83
|
- SidekiqUniqueJobs::Locksmith
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## v6.0.2
|
2
|
+
|
3
|
+
- Fixes sidekiq web pagination of unique digests
|
4
|
+
- Fixes lock_expiration usage (Lua doesn't support expire after persisting a key)
|
5
|
+
|
6
|
+
## v6.0.1
|
7
|
+
|
8
|
+
- Remove unused method that causes conflict with sidekiq/web
|
9
|
+
|
1
10
|
## v6.0.0
|
2
11
|
|
3
12
|
- Complete rewrite of the locking mechanism
|
data/README.md
CHANGED
@@ -379,7 +379,7 @@ end
|
|
379
379
|
|
380
380
|
## Debugging
|
381
381
|
|
382
|
-
There are
|
382
|
+
There are several ways of removing keys that are stuck. The prefered way is by using the unique extension to `Sidekiq::Web`. The old console and command line versions still work but might be deprecated in the future. It is better to search for the digest itself and delete the keys matching that digest.
|
383
383
|
|
384
384
|
### Sidekiq Web
|
385
385
|
|
@@ -106,7 +106,7 @@ module SidekiqUniqueJobs
|
|
106
106
|
end
|
107
107
|
|
108
108
|
# Signal that the token should be released
|
109
|
-
# @param [String] token the unique token to check for a
|
109
|
+
# @param [String] token the unique token to check for a lock.
|
110
110
|
# nil will default to the jid provided in the initializer.
|
111
111
|
# @return [Integer] the number of available lock resources
|
112
112
|
def signal(token = nil)
|
@@ -23,6 +23,20 @@ module SidekiqUniqueJobs
|
|
23
23
|
redis { |conn| conn.scan_each(match: prefix(pattern), count: count).to_a }
|
24
24
|
end
|
25
25
|
|
26
|
+
# Find unique keys with ttl
|
27
|
+
# @param [String] pattern a pattern to scan for in redis
|
28
|
+
# @param [Integer] count the maximum number of keys to delete
|
29
|
+
# @return [Hash<String, Integer>] a hash with active unique keys and corresponding ttl
|
30
|
+
def keys_with_ttl(pattern = SCAN_PATTERN, count = DEFAULT_COUNT)
|
31
|
+
hash = {}
|
32
|
+
redis do |conn|
|
33
|
+
conn.scan_each(match: prefix(pattern), count: count).each do |key|
|
34
|
+
hash[key] = conn.ttl(key)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
hash
|
38
|
+
end
|
39
|
+
|
26
40
|
# Deletes unique keys from redis
|
27
41
|
#
|
28
42
|
# @param [String] pattern a pattern to scan for in redis
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikael Henriksson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|