system_check.rb 414 B

123456789101112131415161718192021
  1. # frozen_string_literal: true
  2. class Admin::SystemCheck
  3. ACTIVE_CHECKS = [
  4. Admin::SystemCheck::DatabaseSchemaCheck,
  5. Admin::SystemCheck::SidekiqProcessCheck,
  6. Admin::SystemCheck::RulesCheck,
  7. ].freeze
  8. def self.perform
  9. ACTIVE_CHECKS.each_with_object([]) do |klass, arr|
  10. check = klass.new
  11. if check.pass?
  12. arr
  13. else
  14. arr << check.message
  15. end
  16. end
  17. end
  18. end