class CronoTrigger::Models::Execution
Public Class Methods
create_with_timestamp!()
click to toggle source
# File lib/crono_trigger/models/execution.rb, line 18 def self.create_with_timestamp! create!(executed_at: Time.current, status: :executing, worker_id: CronoTrigger.config.worker_id) end
Public Instance Methods
complete!()
click to toggle source
# File lib/crono_trigger/models/execution.rb, line 22 def complete! update!(status: :completed, completed_at: Time.current) end
error!(exception)
click to toggle source
# File lib/crono_trigger/models/execution.rb, line 26 def error!(exception) update!(status: :failed, completed_at: Time.current, error_name: exception.class.to_s, error_reason: exception.message) end
retry!()
click to toggle source
# File lib/crono_trigger/models/execution.rb, line 30 def retry! return false if schedule.locking? schedule.retry! end