discourse/app/jobs/regular/forgot_password.rb
Sam 8ec7fd84fd FEATURE: prioritize sidekiq jobs
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
2016-04-07 12:56:43 +10:00

15 lines
316 B
Ruby

# base.rb uses this style of require, so maintain usage of it here
require_dependency "#{Rails.root}/app/jobs/regular/user_email.rb"
module Jobs
class ForgotPassword < UserEmail
sidekiq_options queue: 'critical'
def execute(args)
args[:type] = :forgot_password
super(args)
end
end
end