Skip to content

Commit

Permalink
Ensure tmp files are deleted on failed import (#765)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicko170 authored May 4, 2023
1 parent 572d903 commit 78e00d7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions irrd/mirroring/mirror_runners_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,12 @@ def run(
database_handler=database_handler,
roa_validator=roa_validator,
)
p.run_import()
if to_delete:
os.unlink(import_filename)
try:
p.run_import()
finally:
if to_delete:
os.unlink(import_filename)

if import_serial:
database_handler.record_serial_newest_mirror(self.source, import_serial)

Expand Down

0 comments on commit 78e00d7

Please sign in to comment.