diff --git a/backend/open_webui/__init__.py b/backend/open_webui/__init__.py index 7f808ae70..de34a8bc7 100644 --- a/backend/open_webui/__init__.py +++ b/backend/open_webui/__init__.py @@ -52,9 +52,10 @@ def serve( ) os.environ["USE_CUDA_DOCKER"] = "false" os.environ["LD_LIBRARY_PATH"] = ":".join(LD_LIBRARY_PATH) + import open_webui.main # we need set environment variables before importing main - uvicorn.run("open_webui.main:app", host=host, port=port, forwarded_allow_ips="*") + uvicorn.run(open_webui.main.app, host=host, port=port, forwarded_allow_ips="*") @app.command() diff --git a/backend/open_webui/apps/socket/main.py b/backend/open_webui/apps/socket/main.py index 1c9ff505c..09eb91a6e 100644 --- a/backend/open_webui/apps/socket/main.py +++ b/backend/open_webui/apps/socket/main.py @@ -90,10 +90,14 @@ async def periodic_usage_pool_cleanup(): await asyncio.sleep(TIMEOUT_DURATION) +async def on_startup(): + asyncio.create_task(periodic_usage_pool_cleanup()) + + app = socketio.ASGIApp( sio, socketio_path="/ws/socket.io", - on_startup=asyncio.create_task(periodic_usage_pool_cleanup()), + on_startup=on_startup(), ) diff --git a/package-lock.json b/package-lock.json index 3d8bb8d14..44dc5017b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "open-webui", - "version": "0.3.27.dev1", + "version": "0.3.27.dev2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "open-webui", - "version": "0.3.27.dev1", + "version": "0.3.27.dev2", "dependencies": { "@codemirror/lang-javascript": "^6.2.2", "@codemirror/lang-python": "^6.1.6", diff --git a/package.json b/package.json index f278210ed..f7cf4d635 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "open-webui", - "version": "0.3.27.dev1", + "version": "0.3.27.dev2", "private": true, "scripts": { "dev": "npm run pyodide:fetch && vite dev --host",