discourse/app/jobs/regular/run_heartbeat.rb

Failed to ignore revisions in .git-blame-ignore-revs.

21 lines
377 B
Ruby
Raw Normal View History

# 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