Add nest_asyncio to fix event loop issue
This commit is contained in:
parent
a8779b1205
commit
be9a8c20fc
1 changed files with 2 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ from pathlib import Path
|
|||
from typing import Optional
|
||||
from urllib.parse import urlencode
|
||||
|
||||
import nest_asyncio
|
||||
import socketio # type: ignore
|
||||
from fastapi import FastAPI, Request
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
|
@ -20,6 +21,7 @@ from langflow.utils.logger import configure
|
|||
def get_lifespan(fix_migration=False, socketio_server=None):
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
nest_asyncio.apply()
|
||||
initialize_services(fix_migration=fix_migration, socketio_server=socketio_server)
|
||||
setup_llm_caching()
|
||||
LangfuseInstance.update()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue