about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorPaul Woolcock <paul@woolcock.us>2018-02-26 16:01:49 -0500
committerEugen Rochko <eugen@zeonfederated.com>2018-02-26 22:01:49 +0100
commit76198c63b613f353f2e4a82ce89a8450ca219b88 (patch)
tree65ab2ad241bacc3c5ee47a8a536209c03a67bf13 /lib
parent7150f2e9d3791720131dc77cd889acd0226d6acb (diff)
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 (limited to 'lib')
-rw-r--r--lib/tasks/mastodon.rake10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/tasks/mastodon.rake b/lib/tasks/mastodon.rake
index bf4c53cb3..a06e35226 100644
--- 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