MCPcopy Index your code
hub / github.com/dataease/SQLBot / lifespan

Function lifespan

backend/main.py:51–63  ·  view source on GitHub ↗
(app: FastAPI)

Source from the content-addressed store, hash-verified

49
50@asynccontextmanager
51async def lifespan(app: FastAPI):
52 run_migrations()
53 init_sqlbot_cache()
54 init_dynamic_cors(app)
55 init_terminology_embedding_data()
56 init_data_training_embedding_data()
57 init_table_and_ds_embedding()
58 SQLBotLogUtil.info("✅ SQLBot 初始化完成")
59 await sqlbot_xpack.core.clean_xpack_cache()
60 await async_model_info() # 异步加密已有模型的密钥和地址
61 await sqlbot_xpack.core.monitor_app(app)
62 yield
63 SQLBotLogUtil.info("SQLBot 应用关闭")
64
65
66def custom_generate_unique_id(route: APIRoute) -> str:

Callers

nothing calls this directly

Calls 8

init_sqlbot_cacheFunction · 0.90
init_dynamic_corsFunction · 0.90
async_model_infoFunction · 0.90
run_migrationsFunction · 0.85
infoMethod · 0.45

Tested by

no test coverage detected