Skip to content

Commit

Permalink
retry on timeout
Browse files Browse the repository at this point in the history
Signed-off-by: zliu3 <[email protected]>
  • Loading branch information
zliu3 committed May 20, 2024
1 parent eac1ea6 commit 17edb56
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gordian/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def _set_target_branch(self, target_branch, source_branch=None):
self.branch_name = f"refs/heads/{datetime.datetime.now().strftime('%Y-%m-%d-%H%M%S.%f')}"
self.source_branch = self.target_ref

@retry(GithubException, tries=3, delay=1, backoff=2)
@retry((GithubException, TimeoutError), tries=3, delay=1, backoff=2)
def _get_repo_contents(self, path):
try:
logger.debug(f'Fetching repo contents {path}...')
Expand All @@ -135,6 +135,8 @@ def _get_repo_contents(self, path):
if e.status == 404:
raise e
logger.info(f'Error fetching repo contents: {e}')
except TimeoutError as e:
logger.info(f'Error fetching repo contents: {e}')

@retry(GithubException, tries=3, delay=1, backoff=2)
def _make_branch(self):
Expand Down

0 comments on commit 17edb56

Please sign in to comment.