sidekiq-unique-jobs 6.0.4 → 6.0.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d4687b0a098ec2c297ad6d46a8b9c3fa50d024d79fe0f241a9bd635bb0c99fd
|
4
|
+
data.tar.gz: 2539c5773a5da7bfd1f3ce09bc7b217a9f16b90bc2775e9f64406e68ba3ae509
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebf3ce0a04fe2d9c9ced23bfdd5c3b0cb58efb559bc81c4c2db96b8406ab83c6d86b7c14f46d2954ac1ea25d92a496334f338c559173b5125cfe3ccb01d209a9
|
7
|
+
data.tar.gz: ed0913b11a73d2036159a36d087044d53c9b95fe1b4c239f1181e1dffc681e1bafa9b5eed0449f92967909846afce3af6355c86195027993bf35b60cff8385d9
|
@@ -42,7 +42,7 @@ module SidekiqUniqueJobs
|
|
42
42
|
# @return [String] sidekiq job id when successful
|
43
43
|
# @return [false] when unsuccessful
|
44
44
|
def unlock
|
45
|
-
locksmith.
|
45
|
+
locksmith.unlock(item[JID_KEY]) # Only signal to release the lock
|
46
46
|
end
|
47
47
|
|
48
48
|
# Deletes the job from redis if it is locked.
|
@@ -91,9 +91,9 @@ module SidekiqUniqueJobs
|
|
91
91
|
# Removes the lock keys from Redis
|
92
92
|
# @return [false] unless locked?
|
93
93
|
# @return [String] Sidekiq job_id (jid) if successful
|
94
|
-
def unlock
|
95
|
-
return false unless locked?
|
96
|
-
signal(
|
94
|
+
def unlock(token = nil)
|
95
|
+
return false unless locked?(token)
|
96
|
+
signal(token)
|
97
97
|
end
|
98
98
|
|
99
99
|
# Checks if this instance is considered locked
|
data/redis/signal.lua
CHANGED
@@ -14,10 +14,19 @@ local available_count = redis.call('LPUSH', available_key, token)
|
|
14
14
|
|
15
15
|
if expiration then
|
16
16
|
redis.log(redis.LOG_DEBUG, "signal_locks.lua - expiring stale locks")
|
17
|
+
redis.call('SREM', unique_keys, unique_digest)
|
17
18
|
redis.call('EXPIRE', exists_key, expiration)
|
18
19
|
redis.call('EXPIRE', available_key, expiration)
|
19
20
|
redis.call('EXPIRE', version_key, expiration)
|
20
21
|
redis.call('EXPIRE', unique_digest, expiration) -- TODO: Legacy support (Remove in v6.1)
|
22
|
+
else
|
23
|
+
redis.call('DEL', exists_key)
|
24
|
+
redis.call('SREM', unique_keys, unique_digest)
|
25
|
+
redis.call('DEL', grabbed_key)
|
26
|
+
redis.call('DEL', available_key)
|
27
|
+
redis.call('DEL', version_key)
|
28
|
+
redis.call('DEL', 'uniquejobs') -- TODO: Old job hash, just drop the darn thing
|
29
|
+
redis.call('DEL', unique_digest) -- TODO: Legacy support (Remove in v6.1)
|
21
30
|
end
|
22
31
|
|
23
32
|
return available_count
|
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.5
|
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-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -339,7 +339,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
339
339
|
version: '0'
|
340
340
|
requirements: []
|
341
341
|
rubyforge_project:
|
342
|
-
rubygems_version: 2.7.
|
342
|
+
rubygems_version: 2.7.6
|
343
343
|
signing_key:
|
344
344
|
specification_version: 4
|
345
345
|
summary: Uniqueness for Sidekiq Jobs
|