Skip to content

Commit 9b67690

Browse files
committed
v1.8.8-beta5 retry upload
1 parent 13bf0ca commit 9b67690

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

chatgpt/ChatService.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -467,10 +467,10 @@ async def upload(self, upload_url, file_content, mime_type):
467467
try:
468468
headers = self.base_headers.copy()
469469
headers.update({
470-
'accept': 'application/json, text/plain, */*',
471-
'content-type': mime_type,
472-
'x-ms-blob-type': 'BlockBlob',
473-
'x-ms-version': '2020-04-08',
470+
'accept': 'application/json, text/plain, */*',
471+
'content-type': mime_type,
472+
'x-ms-blob-type': 'BlockBlob',
473+
'x-ms-version': '2020-04-08',
474474
})
475475
r = await self.s.put(upload_url, headers=headers, data=file_content, timeout=120)
476476
if r.status_code == 201:
@@ -479,6 +479,7 @@ async def upload(self, upload_url, file_content, mime_type):
479479
raise HTTPException(status_code=r.status_code, detail=r.text)
480480
except Exception as e:
481481
logger.error(f"Failed to upload file: {e}")
482+
await asyncio.sleep(2)
482483
else:
483484
logger.error(f"Failed to upload file after 3 attempts")
484485
return False

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.8.8-beta4
1+
1.8.8-beta5

0 commit comments

Comments
 (0)