mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-14 10:54:27 +00:00
44b2ee3485
* Add customizable user roles * Various fixes and improvements * Add migration for old settings and fix tootctl role management
30 lines
571 B
Ruby
30 lines
571 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Admin::SystemCheck::SidekiqProcessCheck < Admin::SystemCheck::BaseCheck
|
|
SIDEKIQ_QUEUES = %w(
|
|
default
|
|
push
|
|
mailers
|
|
pull
|
|
scheduler
|
|
).freeze
|
|
|
|
def skip?
|
|
!current_user.can?(:view_devops)
|
|
end
|
|
|
|
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
|