mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
fix: improve cleanup_response positioning for better resource management
Signed-off-by: Sihyeon Jang <sihyeon.jang@navercorp.com>
This commit is contained in:
parent
17f0bef2e2
commit
058369adea
1 changed files with 3 additions and 1 deletions
|
|
@ -184,7 +184,6 @@ async def send_post_request(
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
res = await r.json()
|
res = await r.json()
|
||||||
await cleanup_response(r, session)
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
except HTTPException as e:
|
except HTTPException as e:
|
||||||
|
|
@ -196,6 +195,9 @@ async def send_post_request(
|
||||||
status_code=r.status if r else 500,
|
status_code=r.status if r else 500,
|
||||||
detail=detail if e else "Open WebUI: Server Connection Error",
|
detail=detail if e else "Open WebUI: Server Connection Error",
|
||||||
)
|
)
|
||||||
|
finally:
|
||||||
|
if not stream:
|
||||||
|
await cleanup_response(r, session)
|
||||||
|
|
||||||
|
|
||||||
def get_api_key(idx, url, configs):
|
def get_api_key(idx, url, configs):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue