resque-retry 1.7.0 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.md +4 -0
- data/lib/resque-retry/version.rb +1 -1
- data/lib/resque/plugins/retry.rb +6 -2
- data/test/retry_test.rb +1 -0
- data/test/test_jobs.rb +7 -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: a25bee5749bed00ecedbe4e671973adaedb833864efd07cdfaa0050c9c1af042
|
4
|
+
data.tar.gz: c39a7fc54e5b203612548a7f95dce2fcca70d69a6c9338fbd926d4090d2952db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b65fc789f26a14fabbade5a6cd15e3d6d0ca7ac5aac93d314a12bcbf15e6c3d8d89522c0baa58fdb9f9b22bb49cb5fc9f2abb628ff8ef0fd704439b1a08ac5d
|
7
|
+
data.tar.gz: 7fbc42c237c1bc8c620c6964ff7cb9579996e59cbecdfe6d37bfc58530da0460f633f0985074a9b77c42c3536b375c6a4daf619cc671a2b253e29fccafa762e9
|
data/HISTORY.md
CHANGED
data/lib/resque-retry/version.rb
CHANGED
data/lib/resque/plugins/retry.rb
CHANGED
@@ -135,9 +135,13 @@ module Resque
|
|
135
135
|
#
|
136
136
|
# @api public
|
137
137
|
def retry_delay(exception_class = nil)
|
138
|
-
if
|
138
|
+
if \
|
139
|
+
!exception_class.nil? && \
|
140
|
+
instance_variable_defined?(:@retry_exceptions) && \
|
141
|
+
@retry_exceptions.is_a?(Hash)
|
139
142
|
delay = @retry_exceptions[exception_class] ||= begin
|
140
|
-
relevant_definitions =
|
143
|
+
relevant_definitions = \
|
144
|
+
@retry_exceptions.select { |ex| exception_class <= ex }
|
141
145
|
relevant_definitions.any? ? relevant_definitions.sort.first[1] : 0
|
142
146
|
end
|
143
147
|
# allow an array of delays.
|
data/test/retry_test.rb
CHANGED
@@ -271,6 +271,7 @@ class RetryTest < Minitest::Test
|
|
271
271
|
end
|
272
272
|
|
273
273
|
def test_retry_delay
|
274
|
+
assert_equal 0, NoRetryDelayJob.retry_delay
|
274
275
|
assert_equal 3, NormalRetryCountJob.retry_delay
|
275
276
|
assert_equal 7, PerExceptionClassRetryCountJob.retry_delay(StandardError)
|
276
277
|
assert_equal 7, PerExceptionClassRetryCountJob.retry_delay(CustomException)
|
data/test/test_jobs.rb
CHANGED
@@ -526,6 +526,13 @@ class CustomRetryIdentifierFailingJob
|
|
526
526
|
end
|
527
527
|
end
|
528
528
|
|
529
|
+
class NoRetryDelayJob
|
530
|
+
extend Resque::Plugins::Retry
|
531
|
+
|
532
|
+
@queue = :testing
|
533
|
+
@retry_exceptions = {}
|
534
|
+
end
|
535
|
+
|
529
536
|
class NormalRetryCountJob
|
530
537
|
extend Resque::Plugins::Retry
|
531
538
|
|
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.7.
|
4
|
+
version: 1.7.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: 2019-
|
13
|
+
date: 2019-07-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: resque
|
@@ -223,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
223
223
|
- !ruby/object:Gem::Version
|
224
224
|
version: '0'
|
225
225
|
requirements: []
|
226
|
-
rubygems_version: 3.0.
|
226
|
+
rubygems_version: 3.0.4
|
227
227
|
signing_key:
|
228
228
|
specification_version: 4
|
229
229
|
summary: A resque plugin; provides retry, delay and exponential backoff support for
|