Skip to content

Commit ec77463

Browse files
fix: fix retry function
1 parent fc353c1 commit ec77463

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

git_repo_backup/backup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,14 @@ def fetch_repos(self, repos: List[Tuple[str, str]], service: Service) -> None:
9797
def retry(func: Callable, args: Tuple, max_retries=2) -> None:
9898
for i in range(max_retries):
9999
try:
100-
time.sleep(0.75)
101100
func(*args)
102101
return
103102
# pylint: disable=broad-except
104103
except Exception as err:
104+
time.sleep(0.75)
105105
logging.error("Caught error, retrying %d more times: %s", max_retries - i, err)
106+
if i == max_retries-1:
107+
raise
106108

107109
def fetch_single_repo(self, repo_name: str, remote_url: str, service: Service) -> None:
108110
if service.repo_filter.ignore_repo(repo_name):

0 commit comments

Comments
 (0)