aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/test/jobs/retry_job.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activejob/test/jobs/retry_job.rb')
-rw-r--r--activejob/test/jobs/retry_job.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activejob/test/jobs/retry_job.rb b/activejob/test/jobs/retry_job.rb
index 68dc17e16c..2d19d4c41e 100644
--- a/activejob/test/jobs/retry_job.rb
+++ b/activejob/test/jobs/retry_job.rb
@@ -39,3 +39,12 @@ class RetryJob < ActiveJob::Base
end
end
end
+
+class ExceptionRetryJob < ActiveJob::Base
+ retry_on FirstRetryableErrorOfTwo, SecondRetryableErrorOfTwo, attempts: 4
+ retry_on DefaultsError
+
+ def perform(exceptions)
+ raise exceptions.shift.constantize.new unless exceptions.empty?
+ end
+end