2021-04-03 21:12:30 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Admin::SystemCheck
|
|
|
|
ACTIVE_CHECKS = [
|
|
|
|
Admin::SystemCheck::DatabaseSchemaCheck,
|
|
|
|
Admin::SystemCheck::SidekiqProcessCheck,
|
|
|
|
Admin::SystemCheck::RulesCheck,
|
2022-03-26 05:00:59 +09:00
|
|
|
Admin::SystemCheck::ElasticsearchCheck,
|
2021-04-03 21:12:30 +09:00
|
|
|
].freeze
|
|
|
|
|
2022-07-05 09:41:40 +09:00
|
|
|
def self.perform(current_user)
|
2021-04-03 21:12:30 +09:00
|
|
|
ACTIVE_CHECKS.each_with_object([]) do |klass, arr|
|
2022-07-05 09:41:40 +09:00
|
|
|
check = klass.new(current_user)
|
2021-04-03 21:12:30 +09:00
|
|
|
|
2022-07-05 09:41:40 +09:00
|
|
|
if check.skip? || check.pass?
|
2021-04-03 21:12:30 +09:00
|
|
|
arr
|
|
|
|
else
|
|
|
|
arr << check.message
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|