mirror of
https://github.com/discourse/discourse.git
synced 2025-02-15 00:12:46 +08:00
![Ted Johansson](/assets/img/avatar_default.png)
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).
16 lines
382 B
Ruby
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
|