lib/rocket_job/plugins/retry.rb in rocketjob-2.1.3 vs lib/rocket_job/plugins/retry.rb in rocketjob-3.0.0.alpha

- old
+ new

@@ -24,13 +24,11 @@ # # class MyJob < RocketJob::Job # include RocketJob::Plugins::Retry # # # Set the default retry_count - # rocket_job do |job| - # job.max_retries = 3 - # end + # self.max_retries = 3 # # def perform # puts "DONE" # end # end @@ -50,16 +48,13 @@ included do after_fail :rocket_job_retry # Maximum number of times to retry this job # 25 is approximately 3 weeks of retries - key :max_retries, Integer, default: 25 + field :max_retries, type: Integer, default: 25, class_attribute: true, user_editable: true # List of times when this job failed - key :failed_times, Array - - # Make max_retries editable in Rocket Job Mission Control - public_rocket_job_properties :max_retries + field :failed_times, type: Array, default: [] validates_presence_of :max_retries end # Returns [true|false] whether this job will be automatically retried on failure