2021-04-03 08:12:30 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Admin::SystemCheck
|
|
|
|
ACTIVE_CHECKS = [
|
2023-09-01 11:47:07 -04:00
|
|
|
Admin::SystemCheck::SoftwareVersionCheck,
|
2023-03-16 17:47:01 -04:00
|
|
|
Admin::SystemCheck::MediaPrivacyCheck,
|
2021-04-03 08:12:30 -04:00
|
|
|
Admin::SystemCheck::DatabaseSchemaCheck,
|
|
|
|
Admin::SystemCheck::SidekiqProcessCheck,
|
|
|
|
Admin::SystemCheck::RulesCheck,
|
2022-03-25 16:00:59 -04:00
|
|
|
Admin::SystemCheck::ElasticsearchCheck,
|
2021-04-03 08:12:30 -04:00
|
|
|
].freeze
|
|
|
|
|
2022-07-04 20:41:40 -04:00
|
|
|
def self.perform(current_user)
|
2021-04-03 08:12:30 -04:00
|
|
|
ACTIVE_CHECKS.each_with_object([]) do |klass, arr|
|
2022-07-04 20:41:40 -04:00
|
|
|
check = klass.new(current_user)
|
2021-04-03 08:12:30 -04:00
|
|
|
|
2022-07-04 20:41:40 -04:00
|
|
|
if check.skip? || check.pass?
|
2021-04-03 08:12:30 -04:00
|
|
|
arr
|
|
|
|
else
|
|
|
|
arr << check.message
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|