Class: SolidQueueTui::Actions::RetryJob
- Inherits:
-
Object
- Object
- SolidQueueTui::Actions::RetryJob
- Defined in:
- lib/solid_queue_tui/actions/retry_job.rb
Class Method Summary collapse
Class Method Details
.call(failed_execution_id) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/solid_queue_tui/actions/retry_job.rb', line 6 def self.call(failed_execution_id) fe = SolidQueue::FailedExecution.find(failed_execution_id) fe.retry true rescue ActiveRecord::RecordNotFound false rescue => e false end |
.retry_all(filter: nil, queue: nil) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/solid_queue_tui/actions/retry_job.rb', line 16 def self.retry_all(filter: nil, queue: nil) scope = SolidQueue::FailedExecution.joins(:job) scope = scope.merge(SolidQueue::Job.where("class_name LIKE ?", "%#{filter}%")) if filter.present? scope = scope.merge(SolidQueue::Job.where(queue_name: queue)) if queue.present? count = scope.count return 0 if count == 0 jobs = SolidQueue::Job.where(id: scope.select(:job_id)) SolidQueue::FailedExecution.retry_all(jobs) count rescue => e 0 end |