(app: FastAPI)
| 49 | |
| 50 | @asynccontextmanager |
| 51 | async 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 | |
| 66 | def custom_generate_unique_id(route: APIRoute) -> str: |
nothing calls this directly
no test coverage detected