system_check.rb 544 B

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