Увеличил таймаут на загрузку картинок
This commit is contained in:
parent
150a6ee2a8
commit
6edbd9482d
1 changed files with 6 additions and 2 deletions
|
@ -11,8 +11,12 @@ class ImageService:
|
|||
async def upload_file(file: UploadFile, remote_server_url: str) -> Response:
|
||||
try:
|
||||
file_content = await file.read()
|
||||
async with AsyncClient() as client:
|
||||
response = await client.post(remote_server_url, files={"file": file_content})
|
||||
async with AsyncClient() as ac:
|
||||
response = await ac.post(
|
||||
remote_server_url,
|
||||
files={"file": file_content},
|
||||
timeout=20,
|
||||
)
|
||||
if response.status_code != 200:
|
||||
raise HTTPException(status_code=response.status_code, detail=response.json()["detail"])
|
||||
return response
|
||||
|
|
Loading…
Add table
Reference in a new issue