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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4acedc3a5e5a68e8a87eff5c05d02db56d2230393bc9950af0d60eb0489718bd
4
- data.tar.gz: 5766a03c06859e1b4c36d5b34c4f8f746c38063f946b99633c9481cc92c52b6f
3
+ metadata.gz: a25bee5749bed00ecedbe4e671973adaedb833864efd07cdfaa0050c9c1af042
4
+ data.tar.gz: c39a7fc54e5b203612548a7f95dce2fcca70d69a6c9338fbd926d4090d2952db
5
5
  SHA512:
6
- metadata.gz: ecc9d3abda29d488eeb08b779ec2211dca31965023f0cdc8d69b60c57dfd223b68d7a4fc6d6a650cb55471a16b41c82d69d357264e07cd142c26bd8f3a91d82b
7
- data.tar.gz: 480e49d4b4bfd340cce9e5551f839ea68d38953ce85fd57418b008f227cf23b8692b0ed54466df1603b19e9e8750326f39ddab4dd09b39760a05293df749ba94
6
+ metadata.gz: 4b65fc789f26a14fabbade5a6cd15e3d6d0ca7ac5aac93d314a12bcbf15e6c3d8d89522c0baa58fdb9f9b22bb49cb5fc9f2abb628ff8ef0fd704439b1a08ac5d
7
+ data.tar.gz: 7fbc42c237c1bc8c620c6964ff7cb9579996e59cbecdfe6d37bfc58530da0460f633f0985074a9b77c42c3536b375c6a4daf619cc671a2b253e29fccafa762e9
data/HISTORY.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.7.1 (2019-07-10)
2
+
3
+ * Prevent `NoMethodError` when calculating `retry_delay`
4
+
1
5
  # 1.7.0 (2019-06-15)
2
6
 
3
7
  !!! [Potential] breaking changes -- details below !!!
@@ -1,3 +1,3 @@
1
1
  module ResqueRetry
2
- VERSION = '1.7.0'
2
+ VERSION = '1.7.1'
3
3
  end
@@ -135,9 +135,13 @@ module Resque
135
135
  #
136
136
  # @api public
137
137
  def retry_delay(exception_class = nil)
138
- if instance_variable_defined?(:@retry_exceptions) && @retry_exceptions.is_a?(Hash)
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 = @retry_exceptions.select { |ex| exception_class <= ex }
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.
@@ -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)
@@ -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.0
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-06-15 00:00:00.000000000 Z
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.3
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