Class: SolidQueueGuard::Checks::Runtime::BlockedJobsCheck

Inherits:
Base
  • Object
show all
Defined in:
lib/solid_queue_guard/checks/runtime/blocked_jobs_check.rb

Instance Method Summary collapse

Instance Method Details

#callObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/solid_queue_guard/checks/runtime/blocked_jobs_check.rb', line 7

def call
  with_queue_database do
    blocked = SolidQueue::BlockedExecution.count
    expired = SolidQueue::BlockedExecution.expired.count

    if expired.positive?
      warn(
        check_id,
        "#{expired} blocked job(s) have expired concurrency locks",
        suggestion: 'Verify concurrency release maintenance is running'
      )
    elsif blocked.positive?
      pass(check_id, "#{blocked} job(s) blocked by concurrency control")
    else
      pass(check_id, 'No blocked jobs')
    end
  end
end