9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/solid_queue_guard/checks/runtime/failed_jobs_check.rb', line 9
def call
with_queue_database do
count = SolidQueue::FailedExecution.where(created_at: WINDOW.ago..).count
threshold = config.failed_jobs_threshold
if count > threshold
warn(
check_id,
"#{count} failed job(s) in the last hour (threshold: #{threshold})",
suggestion: 'Review failed jobs in Mission Control or solid_queue_failed_executions',
metadata: { failed_jobs_last_hour: count }
)
else
pass(check_id, "#{count} failed job(s) in the last hour")
end
end
end
|