Revert "FIX: Heartbeat check per sidekiq process (#7873)"

This reverts commit 340855da55.
This commit is contained in:
OsamaSayegh
2019-08-27 11:56:23 +00:00
parent aecadcb267
commit e805d44965
6 changed files with 34 additions and 76 deletions

View File

@@ -2,8 +2,19 @@
module Jobs
class RunHeartbeat < Jobs::Base
sidekiq_options queue: 'critical'
def self.heartbeat_key
'heartbeat_last_run'
end
def execute(args)
Demon::Sidekiq.trigger_heartbeat(args[:queue_name])
$redis.set(self.class.heartbeat_key, Time.new.to_i.to_s)
end
def self.last_heartbeat
$redis.get(heartbeat_key).to_i
end
end
end

View File

@@ -7,9 +7,7 @@ module Jobs
every 3.minute
def execute(args)
Demon::Sidekiq::QUEUE_IDS.each do |identifier|
Jobs.enqueue(:run_heartbeat, queue_name: identifier, queue: identifier)
end
Jobs.enqueue(:run_heartbeat, {})
end
end
end