discourse/app/jobs/regular/problem_check.rb
Ted Johansson 47e58357b6
DEV: Parallel scheduled admin checks (#24190)
This PR does some preparatory refactoring of scheduled admin checks in order for us to be able to do custom retry strategies for some of them.

Instead of running all checks in sequence inside a single, scheduled job, the scheduled job spawns one new job per check.

In order to be concurrency-safe, we need to change the existing Redis data structure from a string (of serialized JSON) to a list of strings (of serialized JSON).
2023-11-03 09:05:29 +08:00

16 lines
382 B
Ruby

# frozen_string_literal: true
module Jobs
# This job runs a singular scheduled admin check. It is scheduled by
# the ProblemChecks (plural) scheduled job.
class ProblemCheck < ::Jobs::Base
sidekiq_options retry: false
def execute(args)
identifier = args[:check_identifier]
AdminDashboardData.execute_scheduled_check(identifier.to_sym)
end
end
end