Class: TimeoutFailedTasksJob
Constant Summary
ContainerBrokerBaseJob::JOB_METRIC
Instance Method Summary
collapse
request_id_from_args
Instance Method Details
#failed_tasks_to_timeout ⇒ Object
20
21
22
|
# File 'app/jobs/timeout_failed_tasks_job.rb', line 20
def failed_tasks_to_timeout
Task.failed.where(:finished_at.lt => Time.current - Settings.timeout_tasks_after_hours)
end
|
6
7
8
|
# File 'app/jobs/timeout_failed_tasks_job.rb', line 6
def perform(*_args)
timeout_failed_tasks
end
|
#timeout_failed_tasks ⇒ Object
10
11
12
13
14
15
16
17
18
|
# File 'app/jobs/timeout_failed_tasks_job.rb', line 10
def timeout_failed_tasks
failed_tasks_to_timeout.map do |task|
Rails.logger.debug("Marking task as error due to timeout: #{task.uuid}")
task.error!
persist_logs(task)
end
end
|