resque-retry 1.8.0 → 1.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/resque-retry/server.rb +11 -2
- data/lib/resque-retry/version.rb +1 -1
- data/test/server_helpers_test.rb +13 -0
- data/test/test_jobs.rb +4 -0
- 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: 562c945b75ddfc1a5136f6966bae9e9cce9b79167ec63c84c68a64d4ee0f9cad
|
4
|
+
data.tar.gz: 8e8069a54b444dd02b8c14ed8bd327a5bde8d33bde64529f3a0de570bcc7a938
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ded662e20a75af089bf98d09b37b95ac3c5b81f4cb0e8f0d2241c5207007d738382baff53682284c1ba157fa50d44648a5e54325d0492418b065a81683dd7cbb
|
7
|
+
data.tar.gz: 6290a973a9576501f8654189ddad0da8df77711c0b3e3aafbfd581faf4de2aef15b1f15eaa0f6f3b43fcf368cd8a0e49ad099fa48b426be84c67e02c17828f0f
|
data/lib/resque-retry/server.rb
CHANGED
@@ -49,12 +49,21 @@ module ResqueRetry
|
|
49
49
|
|
50
50
|
# gets the number of retry attempts for a job.
|
51
51
|
def retry_attempts_for_job(job)
|
52
|
-
|
52
|
+
retry_key = retry_key_for_job(job)
|
53
|
+
if retry_key
|
54
|
+
Resque.redis.get(retry_key)
|
55
|
+
else
|
56
|
+
nil
|
57
|
+
end
|
53
58
|
end
|
54
59
|
|
55
60
|
# gets the failure details hash for a job.
|
56
61
|
def retry_failure_details(retry_key)
|
57
|
-
|
62
|
+
if retry_key
|
63
|
+
Resque.decode(Resque.redis.get("failure-#{retry_key}"))
|
64
|
+
else
|
65
|
+
nil
|
66
|
+
end
|
58
67
|
end
|
59
68
|
|
60
69
|
# reads a 'local' template file.
|
data/lib/resque-retry/version.rb
CHANGED
data/test/server_helpers_test.rb
CHANGED
@@ -19,4 +19,17 @@ class ServerHelpersTest < Minitest::Test
|
|
19
19
|
job = Resque.delayed_timestamp_peek(timestamp, 0, 1).first
|
20
20
|
assert_equal '0', @helpers.retry_attempts_for_job(job), 'should have 0 retry attempt'
|
21
21
|
end
|
22
|
+
|
23
|
+
def test_retry_key_for_job_empty
|
24
|
+
Resque.enqueue(DelayedJobNoRetryKey)
|
25
|
+
perform_next_job(@worker)
|
26
|
+
|
27
|
+
timestamp = Resque.delayed_queue_peek(0, 1).first
|
28
|
+
job = Resque.delayed_timestamp_peek(timestamp, 0, 1).first
|
29
|
+
retry_key = @helpers.retry_key_for_job(job)
|
30
|
+
|
31
|
+
assert_nil retry_key, 'should be nil as the class does not respond to redis_retry_key'
|
32
|
+
assert_nil @helpers.retry_attempts_for_job(job), 'should have nil retry attempts as the key does not exist'
|
33
|
+
assert_nil @helpers.retry_failure_details(retry_key), 'should have nil failure details as the key does not exist'
|
34
|
+
end
|
22
35
|
end
|
data/test/test_jobs.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque-retry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luke Antins
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-
|
13
|
+
date: 2023-06-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: resque
|
@@ -229,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
229
229
|
- !ruby/object:Gem::Version
|
230
230
|
version: '0'
|
231
231
|
requirements: []
|
232
|
-
rubygems_version: 3.
|
232
|
+
rubygems_version: 3.4.14
|
233
233
|
signing_key:
|
234
234
|
specification_version: 4
|
235
235
|
summary: A resque plugin; provides retry, delay and exponential backoff support for
|