Skip to content

Commit

Permalink
FIX: Can't upload backup.
Browse files Browse the repository at this point in the history
* Regression introduced in 142571b
  • Loading branch information
tgxworld committed Apr 6, 2018
1 parent 5da7c2a commit e4a9242
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions app/services/handle_chunk_upload.rb
Expand Up @@ -42,8 +42,11 @@ def merge_chunks
tmp_directory = @params[:tmp_directory]

# delete destination files
File.delete(upload_path)
File.delete(tmp_upload_path)
begin
File.delete(upload_path)
File.delete(tmp_upload_path)
rescue Errno::ENOENT
end

# merge all the chunks
File.open(tmp_upload_path, "a") do |file|
Expand All @@ -59,7 +62,10 @@ def merge_chunks
FileUtils.mv(tmp_upload_path, upload_path, force: true)

# remove tmp directory
FileUtils.rm_rf(tmp_directory)
begin
FileUtils.rm_rf(tmp_directory)
rescue Errno::ENOENT
end
end

end

1 comment on commit e4a9242

@discoursebot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/imported-backups-not-appearing/84459/9

Please sign in to comment.