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.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/activejob/test/jobs/retry_job.rb b/activejob/test/jobs/retry_job.rb
index 3b0dce1a3c..112d672006 100644
--- a/activejob/test/jobs/retry_job.rb
+++ b/activejob/test/jobs/retry_job.rb
@@ -30,7 +30,13 @@ class RetryJob < ActiveJob::Base
discard_on FirstDiscardableErrorOfTwo, SecondDiscardableErrorOfTwo
discard_on(CustomDiscardableError) { |job, error| JobBuffer.add("Dealt with a job that was discarded in a custom way. Message: #{error.message}") }
- def perform(raising, attempts)
+ before_enqueue do |job|
+ if job.arguments.include?(:log_scheduled_at) && job.scheduled_at
+ JobBuffer.add("Next execution scheduled at #{job.scheduled_at}")
+ end
+ end
+
+ def perform(raising, attempts, *)
raising = raising.shift if raising.is_a?(Array)
if raising && executions < attempts
JobBuffer.add("Raised #{raising} for the #{executions.ordinalize} time")