Skip to content
This repository

Fixes #21. MultipleWithRetrySuppression actually have general bug. #22

Merged
merged 1 commit into from over 2 years ago

5 participants

Bogdan Gusiev Kevin Menard Andrii Krykunenko Nicolas Fouché Luke Antins
Bogdan Gusiev

It generated #redis_retry_key from array of arguments rather than arguments.

All the description in #21.

Bogdan Gusiev Fixes #21. MultipleWithRetrySuppression actually have general bug.
It generated #redis_retry_key from array of arguments
rather than arguments.
ae1e36c
Kevin Menard

Any chance we can get this merged in? It's a pretty major bug.

Andrii Krykunenko

+1

Nicolas Fouché

+1

Luke Antins lantins merged commit ae1e36c into from November 22, 2011
Luke Antins lantins closed this November 22, 2011
Luke Antins
Owner

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Aug 09, 2011
Bogdan Gusiev Fixes #21. MultipleWithRetrySuppression actually have general bug.
It generated #redis_retry_key from array of arguments
rather than arguments.
ae1e36c
This page is out of date. Refresh to see the latest.
2  lib/resque/failure/multiple_with_retry_suppression.rb
@@ -70,7 +70,7 @@ def klass
70 70
       end
71 71
 
72 72
       def retry_key
73  
-        klass.redis_retry_key(payload['args'])
  73
+        klass.redis_retry_key(*payload['args'])
74 74
       end
75 75
 
76 76
       def failure_key
8  test/multiple_failure_test.rb
@@ -80,6 +80,14 @@ def test_jobs_without_retry_log_errors
80 80
     assert_equal 5, MockFailureBackend.errors.size
81 81
   end
82 82
 
  83
+  def test_custom_identifier_job
  84
+    Resque.enqueue(CustomIdentifierFailingJob, 'qq', 2)
  85
+    4.times do
  86
+      perform_next_job(@worker)
  87
+    end
  88
+    assert_equal 1, MockFailureBackend.errors.size
  89
+  end
  90
+
83 91
   def teardown
84 92
     Resque::Failure.backend = @old_failure_backend
85 93
   end
17  test/test_jobs.rb
@@ -247,5 +247,22 @@ def self.inherited(subclass)
247 247
   end
248 248
 end
249 249
 
  250
+
250 251
 class InheritOrderingJobExtendFirstSubclass < InheritOrderingJobExtendFirst; end
251 252
 class InheritOrderingJobExtendLastSubclass < InheritOrderingJobExtendLast; end
  253
+
  254
+class CustomIdentifierFailingJob
  255
+  extend Resque::Plugins::Retry
  256
+
  257
+  @queue = :testing
  258
+  @retry_limit = 2
  259
+  @retry_delay = 0
  260
+
  261
+  def self.identifier(*args)
  262
+    args.first.to_s
  263
+  end
  264
+
  265
+  def self.perform(*args)
  266
+    raise 'failed'
  267
+  end
  268
+end
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.