Skip to content

Commit

Permalink
Try more retries to patch intermittent bug
Browse files Browse the repository at this point in the history
  • Loading branch information
stucka committed Jun 19, 2024
1 parent 5fa3627 commit bb0a53d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bln/client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Big Local News Python Client."""

import json
import logging
import os
Expand Down Expand Up @@ -301,7 +302,7 @@ def get_project_by_id(self, id: str):

return project

@retry(APIException, tries=2, delay=10, backoff=2)
@retry(APIException, tries=4, delay=15, backoff=3)
def get_project_by_name(self, name: str):
"""Get the project with the provided name.
Expand All @@ -324,7 +325,7 @@ def get_project_by_name(self, name: str):
# Otherwise, return the one project found
return project_list[0]

@retry(APIException, tries=3, delay=10, backoff=2)
@retry(APIException, tries=4, delay=15, backoff=3)
def download_file(self, projectId, filename, output_dir=None):
"""Download `filename` in project `projectId` to `output_dir`.
Expand Down Expand Up @@ -474,7 +475,7 @@ def _ungraphql(root):
return root


@retry(APIException, tries=3, delay=10, backoff=2)
@retry(APIException, tries=4, delay=15, backoff=3)
def _upload_file(endpoint, token, projectId, path):
logger.debug(f"uploading {path}")
path = os.path.expanduser(path)
Expand Down

0 comments on commit bb0a53d

Please sign in to comment.