Skip to content

Commit

Permalink
fix: add status waiting, print progress content when failed
Browse files Browse the repository at this point in the history
  • Loading branch information
hlf20010508 committed Dec 12, 2023
1 parent a1569f3 commit 3dd4ab4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/handlers/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async def url_handler(event):
while True:
response = onedrive.upload_from_url_progress(progress_url)
progress = response.content
if progress['status'] in ['notStarted', 'inProgress', 'completed']:
if progress['status'] in ['notStarted', 'inProgress', 'completed', 'waiting']:
percentage = float(progress['percentageComplete'])
if total_length > 0:
status_message.status = status_message.template % (total_length * percentage / 100, total_length, percentage)
Expand All @@ -83,7 +83,7 @@ async def url_handler(event):

await asyncio.sleep(5)
else:
raise Exception('status error')
raise Exception('status error: %s' % progress)

except Exception as e:
logger(e)
Expand Down

0 comments on commit 3dd4ab4

Please sign in to comment.