about summary refs log tree commit diff
path: root/lib/tasks/mastodon.rake
diff options
context:
space:
mode:
authorEugen <eugen@zeonfederated.com>2017-04-17 19:58:54 +0200
committerGitHub <noreply@github.com>2017-04-17 19:58:54 +0200
commit15ec4ae07b17821625bd2ca1088a7573a7ed128c (patch)
treeeca4d800f150d90bf3930f500ffa96eb8807b74a /lib/tasks/mastodon.rake
parente43071a2f94354e54816b455e10cc596205af605 (diff)
Fix #1972, fix #1870 - Fix special characters in XML, add tests (#1988)
Also improve efficiency of the mastodon:maintenance:add_static_avatars task
Diffstat (limited to 'lib/tasks/mastodon.rake')
-rw-r--r--lib/tasks/mastodon.rake4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/tasks/mastodon.rake b/lib/tasks/mastodon.rake
index a1947ea0e..453db101c 100644
--- a/lib/tasks/mastodon.rake
+++ b/lib/tasks/mastodon.rake
@@ -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