workaround issue where orphan user_avatar record exists

This commit is contained in:
Sam Saffron 2016-05-17 09:40:17 +10:00
parent 54cfba56dc
commit ce5867cce2
1 changed files with 1 additions and 0 deletions

View File

@ -5,6 +5,7 @@ module Jobs
def execute(args)
# backfill in batches of 5000 an hour
UserAvatar.includes(:user)
.joins(:user)
.where(last_gravatar_download_attempt: nil)
.order("users.last_posted_at DESC")
.limit(5000)