Skip to content

Commit

Permalink
Now tried eliminating temp dir 5 times
Browse files Browse the repository at this point in the history
  • Loading branch information
ayjayt committed Jan 28, 2025
1 parent 1a3bed6 commit b5c5dfe
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions choreographer/utils/_tmpfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,13 @@ def remove_readonly(
_logger.info(f"shutil.rmtree() failed to delete temporary file. Error {e}")

def extra_clean() -> None:
_logger.info("Extra manual clean waiting 3 seconds.")
time.sleep(1)
_logger.info("Extra manual clean executing.")
self._delete_manually()
i = 0
tries = 5
while self.path.exists() and i < tries:
time.sleep(1)
_logger.info("Extra manual clean executing.")
self._delete_manually()
i += 1

# testing doesn't look threads so I guess we'll block
extra_clean()
Expand Down

0 comments on commit b5c5dfe

Please sign in to comment.