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
This commit is contained in:
Sam
2016-04-07 12:56:43 +10:00
parent a5d8dfb07e
commit 8ec7fd84fd
10 changed files with 28 additions and 4 deletions

View File

@ -632,7 +632,7 @@ describe SessionController do
end
it "enqueues an email" do
Jobs.expects(:enqueue).with(:user_email, has_entries(type: :forgot_password, user_id: user.id))
Jobs.expects(:enqueue).with(:forgot_password, has_entries(user_id: user.id))
xhr :post, :forgot_password, login: user.username
end
end