Add system checks to dashboard in admin UI (#15989)

This commit is contained in:
Eugen Rochko 2021-04-03 14:12:30 +02:00 committed by GitHub
parent 82cce18227
commit 487e37d6d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 152 additions and 7 deletions

View file

@ -0,0 +1,26 @@
# frozen_string_literal: true
class Admin::SystemCheck::SidekiqProcessCheck < Admin::SystemCheck::BaseCheck
SIDEKIQ_QUEUES = %w(
default
push
mailers
pull
scheduler
ingress
).freeze
def pass?
missing_queues.empty?
end
def message
Admin::SystemCheck::Message.new(:sidekiq_process_check, missing_queues.join(', '))
end
private
def missing_queues
@missing_queues ||= Sidekiq::ProcessSet.new.reduce(SIDEKIQ_QUEUES) { |queues, process| queues - process['queues'] }
end
end