mirror of
https://github.com/discourse/discourse.git
synced 2025-03-22 18:15:30 +08:00
DEV: Don't copy file when trying to recover missing uploads.
This commit is contained in:
parent
7cabc47945
commit
f3c13d80c9
@ -434,11 +434,7 @@ def missing_uploads
|
||||
end
|
||||
|
||||
if file_path.present?
|
||||
tmp = Tempfile.new
|
||||
tmp.write(File.read(file_path))
|
||||
tmp.rewind
|
||||
|
||||
if upload = UploadCreator.new(tmp, File.basename(path)).create_for(Discourse.system_user.id)
|
||||
if upload = UploadCreator.new(File.open(file_path), File.basename(path)).create_for(Discourse.system_user.id)
|
||||
upload_id = upload.id
|
||||
DbHelper.remap(UrlHelper.absolute(src), upload.url)
|
||||
|
||||
@ -451,8 +447,6 @@ def missing_uploads
|
||||
post.rebake!
|
||||
end
|
||||
end
|
||||
|
||||
FileUtils.rm(tmp, force: true)
|
||||
else
|
||||
old_scheme_upload_count += 1
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user