mirror of
https://github.com/discourse/discourse.git
synced 2026-08-08 16:57:36 +08:00
19 lines
376 B
Ruby
Vendored
19 lines
376 B
Ruby
Vendored
# 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
|