job should warn about corrupt user_avatar records

This commit is contained in:
Sam 2014-05-28 19:55:33 +10:00
parent 3e36d0698c
commit 1a31eb1d97

View file

@ -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