Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: restore tempfile created 0 B #464

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions dbbackup/management/commands/dbrestore.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,16 @@ def _restore_backup(self):
)
input_file.close()
input_file = unencrypted_file
input_file.seek(0)
if self.uncompress:
uncompressed_file, input_filename = utils.uncompress_file(
input_file, input_filename
)
input_file.close()
input_file = uncompressed_file
if not self.decrypt and not self.uncompress:
tmp_file = utils.create_spooled_temporary_file(fileobj=input_file)
input_file = tmp_file

self.logger.info("Restore tempfile created: %s", utils.handle_size(input_file))
if self.interactive:
Expand Down
Loading