logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe
commit: 76198c63b613f353f2e4a82ce89a8450ca219b88
parent: 7150f2e9d3791720131dc77cd889acd0226d6acb
Author: Paul Woolcock <paul@woolcock.us>
Date:   Mon, 26 Feb 2018 16:01:49 -0500

Some images can cause `convert` to fail, which crashes this whole task (#6565)

* Some images can cause `convert` to fail, which crashes this whole task

* Add more specific exception

Diffstat:

Mlib/tasks/mastodon.rake10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lib/tasks/mastodon.rake b/lib/tasks/mastodon.rake @@ -494,9 +494,13 @@ namespace :mastodon do accounts = accounts.where(domain: ENV['DOMAIN']) if ENV['DOMAIN'].present? accounts.find_each do |account| - account.reset_avatar! - account.reset_header! - account.save + begin + account.reset_avatar! + account.reset_header! + account.save + rescue Paperclip::Error + puts "Error resetting avatar and header for account #{username}@#{domain}" + end end end end