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
lolsob-rspec
ThibG 2019-07-08 02:24:25 +02:00 committed by Thibaut Girka
parent 852b0a9765
commit 1d8a374f2a
1 changed files with 2 additions and 0 deletions

View File

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