1234567891011121314151617181920212223242526272829303132333435 |
- class Scheduler < ApplicationModel
- include ChecksHtmlSanitized
- include HasTimeplan
- validates :note, length: { maximum: 250 }
- sanitized_html :note
- scope :failed_jobs, -> { where(status: 'error', active: false) }
-
-
-
-
-
-
- def runs_as_persistent_loop?
- active && period && period <= 5.minutes
- end
-
-
-
-
-
-
- def self.restart_failed_jobs
- failed_jobs.each do |job|
- job.update!(active: true)
- end
- true
- end
- end
|