mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-07 05:03:26 +08:00
Ensure temp files deletion after export is done [SCI-2646]
This commit is contained in:
parent
2f6a6072e1
commit
b7fdd82409
2 changed files with 6 additions and 8 deletions
|
@ -30,10 +30,9 @@ class TeamZipExport < ZipExport
|
|||
fill_content(dir_to_zip, data, type, options)
|
||||
zip!(dir_to_zip, output_file.path)
|
||||
self.zip_file = File.open(output_file)
|
||||
if save
|
||||
FileUtils.rm_rf([dir_to_zip, output_file], secure: true)
|
||||
generate_notification(user)
|
||||
end
|
||||
generate_notification(user) if save
|
||||
ensure
|
||||
FileUtils.rm_rf([dir_to_zip, output_file], secure: true)
|
||||
end
|
||||
|
||||
handle_asynchronously :generate_exportable_zip
|
||||
|
|
|
@ -60,10 +60,9 @@ class ZipExport < ApplicationRecord
|
|||
fill_content(dir_to_zip, data, type, options)
|
||||
zip!(dir_to_zip, output_file.path)
|
||||
self.zip_file = File.open(output_file)
|
||||
if save
|
||||
FileUtils.rm_rf([dir_to_zip, output_file], secure: true)
|
||||
generate_notification(user)
|
||||
end
|
||||
generate_notification(user) if save
|
||||
ensure
|
||||
FileUtils.rm_rf([dir_to_zip, output_file], secure: true)
|
||||
end
|
||||
|
||||
handle_asynchronously :generate_exportable_zip
|
||||
|
|
Loading…
Reference in a new issue