mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 17:53:40 +08:00
17bed44405
We need to schedule heartbeat on the correct host, otherwise some queues may end up starving.
17 lines
355 B
Ruby
17 lines
355 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Jobs
|
|
|
|
# used to ensure at least 1 sidekiq is running correctly
|
|
class Heartbeat < Jobs::Scheduled
|
|
per_host
|
|
every 3.minute
|
|
|
|
def execute(args)
|
|
Demon::Sidekiq::QUEUE_IDS.each do |identifier|
|
|
Jobs.enqueue(:run_heartbeat, queue_name: identifier, queue: identifier)
|
|
end
|
|
end
|
|
end
|
|
end
|