mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 19:05:18 +08: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
21 lines
448 B
Ruby
21 lines
448 B
Ruby
module Jobs
|
|
|
|
class UpdateGravatar < Jobs::Base
|
|
|
|
sidekiq_options queue: 'low'
|
|
|
|
def execute(args)
|
|
user = User.find_by(id: args[:user_id])
|
|
avatar = UserAvatar.find_by(id: args[:avatar_id])
|
|
|
|
if user && avatar
|
|
avatar.update_gravatar!
|
|
if !user.uploaded_avatar_id && avatar.gravatar_upload_id
|
|
user.update_column(:uploaded_avatar_id, avatar.gravatar_upload_id)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
end
|