Fix backups failing when files are missing from media attachments (#13146)

Fixes #13123
pull/13148/head
ThibG 2020-02-24 21:18:26 +01:00 committed by GitHub
parent 3704402dcc
commit d91946ae13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -66,6 +66,8 @@ class BackupService < BaseService
def dump_media_attachments!(tar) def dump_media_attachments!(tar)
MediaAttachment.attached.where(account: account).reorder(nil).find_in_batches do |media_attachments| MediaAttachment.attached.where(account: account).reorder(nil).find_in_batches do |media_attachments|
media_attachments.each do |m| media_attachments.each do |m|
next unless m.file&.path
download_to_tar(tar, m.file, m.file.path) download_to_tar(tar, m.file, m.file.path)
end end