Skip to content
Merged
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
10 changes: 5 additions & 5 deletions mcserver/zipsession_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,6 @@ def rmtree_with_retry(path, max_retries=5, backoff=0.1):
try:
shutil.rmtree(path)
return

except (PermissionError, OSError) as e:
if attempt == max_retries - 1:
raise
time.sleep(backoff * (2**attempt))

except FileNotFoundError as e:
# In case we've made it here, we've made a best effort to delete
Expand All @@ -348,6 +343,11 @@ def rmtree_with_retry(path, max_retries=5, backoff=0.1):
return
time.sleep(backoff * (2**attempt))

except (PermissionError, OSError) as e:
if attempt == max_retries - 1:
raise
time.sleep(backoff * (2**attempt))

def zipdir_contents_with_retry(dir_path, zip_path, max_retries=5, backoff=0.1):
"""
Given a source dir_path and a target zip_path, zip the folder with
Expand Down
Loading