'commit'
This commit is contained in:
10
Start.py
10
Start.py
@@ -31,7 +31,7 @@ def setup_api_logger():
|
||||
|
||||
|
||||
logger = setup_api_logger()
|
||||
logger.info("YLT_Analytics_Api module imported")
|
||||
logger.info("驿来特AI智能分析系统模块导入完成!")
|
||||
|
||||
from Controller.YltAnalyticsController import router as ylt_router, init_db, close_db
|
||||
from Controller.DegreeController import router as degree_router
|
||||
@@ -42,18 +42,18 @@ patch()
|
||||
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
logger.info("YLT Analytics API startup")
|
||||
logger.info("驿来特AI智能分析系统开始启动...")
|
||||
await init_db()
|
||||
# Initialize Redis connection
|
||||
await RedisKit().get_connection()
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
logger.info("YLT Analytics API shutdown")
|
||||
logger.info("驿来特AI智能分析系统关闭...")
|
||||
await close_db()
|
||||
|
||||
|
||||
app = FastAPI(title="YLT Analytics API", lifespan=lifespan)
|
||||
app = FastAPI(title="驿来特AI智能分析系统", lifespan=lifespan)
|
||||
|
||||
static_dir = os.path.join(project_root, "static")
|
||||
app.mount("/static", StaticFiles(directory=static_dir), name="static")
|
||||
@@ -64,7 +64,7 @@ app.include_router(degree_router)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
logger.info("Starting YLT Analytics API with uvicorn on http://0.0.0.0:8000")
|
||||
logger.info("Starting 驿来特AI智能分析系统 with uvicorn on http://0.0.0.0:8000")
|
||||
import uvicorn
|
||||
|
||||
uvicorn.run(app, host="0.0.0.0", port=8000)
|
||||
|
||||
Reference in New Issue
Block a user