mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 00:13:37 +08:00
FIX: ensure we only ever enqueue 1 UpdateGravatar job
This commit is contained in:
parent
fad017d842
commit
868e70e817
|
@ -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 New Issue
Block a user