]> cat aescling's git repositories - mastodon.git/commitdiff
Some images can cause `convert` to fail, which crashes this whole task (#6565)
authorPaul Woolcock <paul@woolcock.us>
Mon, 26 Feb 2018 21:01:49 +0000 (16:01 -0500)
committerEugen Rochko <eugen@zeonfederated.com>
Mon, 26 Feb 2018 21:01:49 +0000 (22:01 +0100)
* Some images can cause `convert` to fail, which crashes this whole task

* Add more specific exception

lib/tasks/mastodon.rake

index bf4c53cb34229eb8228136c47582832f856c0abe..a06e35226bbbeb108ea27383b4bfabefc81e1bd9 100644 (file)
@@ -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