~cytrogen/masto-fe

bd77fd6ff3cf17a512d26547f78af1e804bd432d — ThibG 6 years ago b073008
Fix BackupService crashing when an attachment is missing (#11241)

* 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
1 files changed, 2 insertions(+), 0 deletions(-)

M app/services/backup_service.rb
M app/services/backup_service.rb => app/services/backup_service.rb +2 -0
@@ 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