Skip to content

Commit b5c5dfe

Browse files
committed
Now tried eliminating temp dir 5 times
1 parent 1a3bed6 commit b5c5dfe

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

choreographer/utils/_tmpfile.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,13 @@ def remove_readonly(
185185
_logger.info(f"shutil.rmtree() failed to delete temporary file. Error {e}")
186186

187187
def extra_clean() -> None:
188-
_logger.info("Extra manual clean waiting 3 seconds.")
189-
time.sleep(1)
190-
_logger.info("Extra manual clean executing.")
191-
self._delete_manually()
188+
i = 0
189+
tries = 5
190+
while self.path.exists() and i < tries:
191+
time.sleep(1)
192+
_logger.info("Extra manual clean executing.")
193+
self._delete_manually()
194+
i += 1
192195

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

0 commit comments

Comments
 (0)