mirror of
https://github.com/discourse/discourse.git
synced 2025-02-07 04:36:32 +08:00
17 lines
287 B
Ruby
17 lines
287 B
Ruby
module Jobs
|
|
class RunHeartbeat < Jobs::Base
|
|
|
|
def self.heartbeat_key
|
|
'heartbeat_last_run'
|
|
end
|
|
|
|
def execute(args)
|
|
$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
|