Skip to content

Commit

Permalink
Fix disk cleanup bug
Browse files Browse the repository at this point in the history
  • Loading branch information
pierotofy committed Mar 24, 2021
1 parent 2221e14 commit 6574ffd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions stages/run_opensfm.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ def cleanup_disk_space():
if args.optimize_disk_space:
for folder in ["features", "matches", "exif", "reports"]:
folder_path = octx.path(folder)
if os.path.islink(folder_path):
os.unlink(folder_path)
else:
shutil.rmtree(folder_path)
if os.path.exists(folder_path):
if os.path.islink(folder_path):
os.unlink(folder_path)
else:
shutil.rmtree(folder_path)

# If we find a special flag file for split/merge we stop right here
if os.path.exists(octx.path("split_merge_stop_at_reconstruction.txt")):
Expand Down

0 comments on commit 6574ffd

Please sign in to comment.