7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/solid_queue_guard/checks/runtime/scheduled_backlog_check.rb', line 7
def call
with_queue_database do
due_count = SolidQueue::ScheduledExecution.due.count
threshold = config.check_setting(:scheduled_backlog, :threshold, config.scheduled_backlog_threshold)
if due_count > threshold
warn(
check_id,
"Scheduled backlog is #{due_count} (threshold: #{threshold})",
suggestion: 'Check dispatcher health and scheduled job volume'
)
else
pass(check_id, "Scheduled backlog is #{due_count}")
end
end
end
|