mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
job should warn about corrupt user_avatar records
This commit is contained in:
parent
3e36d0698c
commit
1a31eb1d97
1 changed files with 5 additions and 1 deletions
|
@ -5,7 +5,11 @@ module Jobs
|
|||
UserAvatar
|
||||
.where("system_upload_id IS NULL OR system_avatar_version != ?", UserAvatar::SYSTEM_AVATAR_VERSION)
|
||||
.find_each do |a|
|
||||
a.update_system_avatar!
|
||||
if a.user
|
||||
a.update_system_avatar!
|
||||
else
|
||||
Rails.logger.warn("Detected stray avatar for avatar_user_id #{a.id}")
|
||||
end
|
||||
end
|
||||
|
||||
# backfill in batches 5000 an hour
|
||||
|
|
Loading…
Reference in a new issue