添加定时任务配置

This commit is contained in:
2026-01-15 11:10:19 +08:00
parent a3107403d8
commit 1e8ae960cd
6 changed files with 43 additions and 2 deletions

View File

@@ -10,6 +10,12 @@ def init_database():
create_db_and_tables()
logger.info("[数据库] 数据库初始化完成 ✅")
def init_scheduler(app : FastAPI):
from scheduler import init_scheduler_router
logger.info("[定时任务] 初始化定时任务 📦")
init_scheduler_router(app)
logger.info("[定时任务] 定时任务初始化完成 ✅")
def active_config():
logger.info(f"[激活配置] 加载配置 ⚙️")
@@ -31,5 +37,6 @@ async def lifespan(app: FastAPI):
active_config()
init_database()
import_router(app)
init_scheduler(app)
yield
logger.info(f"[生命周期] 应用关闭 🔧✅")