DEV: rescue avatar rake tasks with error backtrace

This commit is contained in:
Arpit Jalan 2019-04-15 14:06:29 +05:30
parent 594674703c
commit 07b961ab13
1 changed files with 4 additions and 4 deletions

View File

@ -9,8 +9,8 @@ task "avatars:refresh" => :environment do
begin
user.refresh_avatar
user.user_avatar.update_gravatar!
rescue
# skip
rescue => e
puts "", "Failed to refresh avatar for #{user.username}", e, e.backtrace.join("\n")
end
putc "." if (i += 1) % 10 == 0
end
@ -31,8 +31,8 @@ task "avatars:clean" => :environment do
.find_each do |optimized_image|
begin
optimized_image.destroy!
rescue
# skip
rescue => e
puts "", "Failed to cleanup avatar for #{user.username}", e, e.backtrace.join("\n")
end
putc "." if (i += 1) % 10 == 0
end