discourse/app/jobs/regular/run_heartbeat.rb
Jarek Radosz 85e03a7f68
DEV: Replace Time.new with Time.now (#9142)
(or `Time.zone.now`)
2020-03-09 17:37:49 +01:00

21 lines
377 B
Ruby

# frozen_string_literal: true
module Jobs
class RunHeartbeat < ::Jobs::Base
sidekiq_options queue: 'critical'
def self.heartbeat_key
'heartbeat_last_run'
end
def execute(args)
Discourse.redis.set(self.class.heartbeat_key, Time.now.to_i.to_s)
end
def self.last_heartbeat
Discourse.redis.get(heartbeat_key).to_i
end
end
end