Also remove temp file after other types of ZIP export generation [SCI-2646]

This commit is contained in:
Matej Zrimšek 2018-11-04 01:39:16 +01:00
parent 5defbdd76e
commit ee611a45d9

View file

@ -58,7 +58,10 @@ 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)
generate_notification(user) if save
if save
FileUtils.rm_rf([dir_to_zip, output_file], secure: true)
generate_notification(user)
end
end
handle_asynchronously :generate_exportable_zip