You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
515 B

  1. # frozen_string_literal: true
  2. class Admin::SystemCheck::SidekiqProcessCheck < Admin::SystemCheck::BaseCheck
  3. SIDEKIQ_QUEUES = %w(
  4. default
  5. push
  6. mailers
  7. pull
  8. scheduler
  9. ).freeze
  10. def pass?
  11. missing_queues.empty?
  12. end
  13. def message
  14. Admin::SystemCheck::Message.new(:sidekiq_process_check, missing_queues.join(', '))
  15. end
  16. private
  17. def missing_queues
  18. @missing_queues ||= Sidekiq::ProcessSet.new.reduce(SIDEKIQ_QUEUES) { |queues, process| queues - process['queues'] }
  19. end
  20. end