]> cat aescling's git repositories - mastodon.git/commitdiff
Fix BackupService crashing when an attachment is missing (#11241)
authorThibG <thib@sitedethib.com>
Mon, 8 Jul 2019 00:24:25 +0000 (02:24 +0200)
committerThibaut Girka <thib@sitedethib.com>
Sun, 14 Jul 2019 22:48:49 +0000 (00:48 +0200)
* Fix BackupService crashing when an attachment is missing

For various reasons such as admin error or out-of-sync media and
database backups, it might be possible for local attachments to be lost.

This commit allows the BackupService to continue its work even if some media
file is missing.

* Change error message

app/services/backup_service.rb

index bd9e77223c5dff72dfa9ccfb42f216b6cf2a107c..cc9fb1f4ecd68f622a7811a0eee8d0ce6bc172f9 100644 (file)
@@ -164,5 +164,7 @@ class BackupService < BaseService
         io.write(buffer)
       end
     end
+  rescue Errno::ENOENT
+    Rails.logger.warn "Could not backup file #{filename}: file not found"
   end
 end