Class: Jobs::RunProblemChecks
- Defined in:
- app/jobs/scheduled/run_problem_checks.rb
Overview
This job runs all of the scheduled problem checks for the admin dashboard on a regular basis. To add a problem check, add a new class that inherits the ‘ProblemCheck` base class.
Instance Method Summary collapse
Methods inherited from Scheduled
Methods inherited from Base
acquire_cluster_concurrency_lock!, clear_cluster_concurrency_lock!, cluster_concurrency, cluster_concurrency_redis_key, delayed_perform, #error_context, get_cluster_concurrency, #last_db_duration, #log, #perform, #perform_immediately
Instance Method Details
#execute(_args) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'app/jobs/scheduled/run_problem_checks.rb', line 12 def execute(_args) scheduled_checks = ProblemCheckTracker.all.filter_map do |tracker| tracker.check if eligible_for_this_run?(tracker) end scheduled_checks.each do |check| Jobs.enqueue(:run_problem_check, check_identifier: check.identifier.to_s) end end |