Skip to content

Commit

Permalink
Update _biliarchiver_upload_bvid.py
Browse files Browse the repository at this point in the history
  • Loading branch information
yzqzss authored Jun 19, 2024
1 parent d0245fd commit 9e4f251
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions biliarchiver/_biliarchiver_upload_bvid.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def _upload_bvid(

if filedict:
upload_retry = 5
while upload_retry > 0:
while upload_retry >= 0:
try:
r = item.upload(
files=filedict,
Expand All @@ -246,11 +246,12 @@ def _upload_bvid(
)
break
except Exception as e:
print(e)
upload_retry -= 1
print(e)
if upload_retry < 0:
raise e
print(f"Upload failed, retrying ({upload_retry}) ...")
time.sleep(30 * (6 - upload_retry))
assert upload_retry > 0, "Upload failed"
time.sleep(min(30 * (6 - upload_retry), 240))

tries = 100
item = get_item(remote_identifier) # refresh item
Expand Down

0 comments on commit 9e4f251

Please sign in to comment.