提交
This commit is contained in:
1 parent
80138c6388
commit
693e8a678e
682 files changed
+211375
-5306
No files matched your search
@@ -30,8 +30,20 @@ async def lifespan(app: FastAPI):
|
||||
except Exception as e:
|
||||
logging.warning("定时任务调度器启动失败: %s", e)
|
||||
|
||||
from app.services.cn_holiday_sync import start_cn_holiday_sync_loop, stop_cn_holiday_sync_loop
|
||||
|
||||
try:
|
||||
start_cn_holiday_sync_loop(SessionLocal)
|
||||
except Exception as e:
|
||||
logging.warning("节假日同步线程启动失败: %s", e)
|
||||
|
||||
yield
|
||||
|
||||
try:
|
||||
stop_cn_holiday_sync_loop()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
from app.tasks import shutdown_scheduler
|
||||
|
||||
try:
|
||||
|
||||
Reference in new issue
Block a user