mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FIX: ensure we only ever enqueue 1 UpdateGravatar job
This commit is contained in:
parent
fad017d842
commit
868e70e817
1 changed files with 2 additions and 1 deletions
|
@ -753,7 +753,8 @@ class User < ActiveRecord::Base
|
||||||
avatar = user_avatar || create_user_avatar
|
avatar = user_avatar || create_user_avatar
|
||||||
|
|
||||||
if SiteSetting.automatically_download_gravatars? && !avatar.last_gravatar_download_attempt
|
if SiteSetting.automatically_download_gravatars? && !avatar.last_gravatar_download_attempt
|
||||||
Jobs.enqueue(:update_gravatar, user_id: self.id, avatar_id: avatar.id)
|
Jobs.cancel_scheduled_job(:update_gravatar, user_id: self.id, avatar_id: avatar.id)
|
||||||
|
Jobs.enqueue_in(1.second, :update_gravatar, user_id: self.id, avatar_id: avatar.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
# mark all the user's quoted posts as "needing a rebake"
|
# mark all the user's quoted posts as "needing a rebake"
|
||||||
|
|
Loading…
Reference in a new issue