Add temp file to cleanup list just once when its first created

This commit is contained in:
Micah Lee 2021-12-02 18:51:06 -08:00
parent b3d53ca2f2
commit 1dde6f6deb
No known key found for this signature in database
GPG key ID: 403C2657CD994F73

View file

@ -200,11 +200,11 @@ class SendBaseModeWeb:
self._gzip_compress(filesystem_path, gzip_file.name, 6, None)
self.gzip_individual_files[filesystem_path] = gzip_file.name
file_to_download = self.gzip_individual_files[filesystem_path]
filesize = os.path.getsize(self.gzip_individual_files[filesystem_path])
# Cleanup this temp file
self.web.cleanup_tempfiles.append(gzip_file)
file_to_download = self.gzip_individual_files[filesystem_path]
filesize = os.path.getsize(self.gzip_individual_files[filesystem_path])
else:
file_to_download = filesystem_path
filesize = os.path.getsize(filesystem_path)