discourse/app/jobs/scheduled/heartbeat.rb
Sam Saffron 17bed44405 FIX: heartbeat should be per host
We need to schedule heartbeat on the correct host, otherwise some queues
may end up starving.
2019-08-30 16:10:08 +10:00

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