Skip to content

Commit

Permalink
Try to handle google upload error 429 tpp many requests (EOF...)
Browse files Browse the repository at this point in the history
with google grive api lib

Signed-off-by: anasty17 <[email protected]>
  • Loading branch information
anasty17 committed Dec 28, 2023
1 parent 02154c8 commit 86234e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bot/helper/mirror_utils/gdrive_utils/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def _download_file(self, file_id, path, filename, mime_type):
try:
self.status, done = downloader.next_chunk()
except HttpError as err:
if err.resp.status in [500, 502, 503, 504] and retries < 10:
if err.resp.status in [500, 502, 503, 504, 429] and retries < 10:
retries += 1
continue
if err.resp.get("content-type", "").startswith("application/json"):
Expand Down
2 changes: 1 addition & 1 deletion bot/helper/mirror_utils/gdrive_utils/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def _upload_file(self, file_path, file_name, mime_type, dest_id, is_dir=True):
try:
self.status, response = drive_file.next_chunk()
except HttpError as err:
if err.resp.status in [500, 502, 503, 504] and retries < 10:
if err.resp.status in [500, 502, 503, 504, 429] and retries < 10:
retries += 1
continue
if err.resp.get("content-type", "").startswith("application/json"):
Expand Down

0 comments on commit 86234e1

Please sign in to comment.