about summary refs log tree commit diff
path: root/lib/tasks/mastodon.rake
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tasks/mastodon.rake')
-rw-r--r--lib/tasks/mastodon.rake6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/tasks/mastodon.rake b/lib/tasks/mastodon.rake
index b47730274..453db101c 100644
--- a/lib/tasks/mastodon.rake
+++ b/lib/tasks/mastodon.rake
@@ -100,7 +100,7 @@ namespace :mastodon do
       # only have a user record and an avatar record, with no files uploaded
       User.where('confirmed_at is NULL AND confirmation_sent_at <= ?', 2.days.ago).find_in_batches do |batch|
         Account.where(id: batch.map(&:account_id)).delete_all
-        batch.delete_all
+        User.where(id: batch.map(&:id)).delete_all
       end
     end
   end
@@ -145,8 +145,8 @@ namespace :mastodon do
 
       Account.unscoped.where(avatar_content_type: 'image/gif').or(Account.unscoped.where(header_content_type: 'image/gif')).find_each do |account|
         begin
-          account.avatar.reprocess!
-          account.header.reprocess!
+          account.avatar.reprocess! if account.avatar_content_type == 'image/gif' && !account.avatar.exists?(:static)
+          account.header.reprocess! if account.header_content_type == 'image/gif' && !account.header.exists?(:static)
         rescue StandardError => e
           Rails.logger.error "Error while generating static avatars/headers for account #{account.id}: #{e}"
           next