mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
8ec7fd84fd
This commit introduces 3 queues for sidekiq "critical" for urgent jobs (weighted at 4x weight) "default" for standard jobs(weighted at 2x weight) "low" for less important jobs "critical jobs" Reset Password emails has been seperated to its own job Heartbeat which is required to keep sidekiq running Test email which needs to return real quick "low priority jobs" Notify mailing list Pull hotlinked images Update gravatar "default" All the rest Note: for people running sidekiq from command line use bin/sidekiq -q critical,4 -q default,2 -q low
18 lines
326 B
Ruby
18 lines
326 B
Ruby
module Jobs
|
|
class RunHeartbeat < Jobs::Base
|
|
|
|
sidekiq_options queue: 'critical'
|
|
|
|
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
|