DEV: rescue avatar rake tasks with error backtrace
This commit is contained in:
parent
594674703c
commit
07b961ab13
|
@ -9,8 +9,8 @@ task "avatars:refresh" => :environment do
|
||||||
begin
|
begin
|
||||||
user.refresh_avatar
|
user.refresh_avatar
|
||||||
user.user_avatar.update_gravatar!
|
user.user_avatar.update_gravatar!
|
||||||
rescue
|
rescue => e
|
||||||
# skip
|
puts "", "Failed to refresh avatar for #{user.username}", e, e.backtrace.join("\n")
|
||||||
end
|
end
|
||||||
putc "." if (i += 1) % 10 == 0
|
putc "." if (i += 1) % 10 == 0
|
||||||
end
|
end
|
||||||
|
@ -31,8 +31,8 @@ task "avatars:clean" => :environment do
|
||||||
.find_each do |optimized_image|
|
.find_each do |optimized_image|
|
||||||
begin
|
begin
|
||||||
optimized_image.destroy!
|
optimized_image.destroy!
|
||||||
rescue
|
rescue => e
|
||||||
# skip
|
puts "", "Failed to cleanup avatar for #{user.username}", e, e.backtrace.join("\n")
|
||||||
end
|
end
|
||||||
putc "." if (i += 1) % 10 == 0
|
putc "." if (i += 1) % 10 == 0
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue