mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 12:25:20 +00:00
Simplify import
This commit is contained in:
parent
19b3d88737
commit
e19554e9a8
1 changed files with 2 additions and 3 deletions
|
|
@ -11,8 +11,7 @@ import random
|
||||||
|
|
||||||
from contextlib import asynccontextmanager
|
from contextlib import asynccontextmanager
|
||||||
from urllib.parse import urlencode, parse_qs, urlparse
|
from urllib.parse import urlencode, parse_qs, urlparse
|
||||||
import anyio
|
from anyio import to_thread
|
||||||
import anyio.to_thread
|
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
from sqlalchemy import text
|
from sqlalchemy import text
|
||||||
|
|
||||||
|
|
@ -440,7 +439,7 @@ async def lifespan(app: FastAPI):
|
||||||
|
|
||||||
pool_size = THREAD_POOL_SIZE
|
pool_size = THREAD_POOL_SIZE
|
||||||
if pool_size and pool_size > 0:
|
if pool_size and pool_size > 0:
|
||||||
anyio.to_thread.current_default_thread_limiter().total_tokens = pool_size
|
to_thread.current_default_thread_limiter().total_tokens = pool_size
|
||||||
|
|
||||||
asyncio.create_task(periodic_usage_pool_cleanup())
|
asyncio.create_task(periodic_usage_pool_cleanup())
|
||||||
yield
|
yield
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue