Browse Source

fix(account): shutdown 也加 try-except 防多 router 重复关闭

alphah 1 tuần trước cách đây
mục cha
commit
702ca42b3c
1 tập tin đã thay đổi với 6 bổ sung3 xóa
  1. 6 3
      backend/app/plugin/module_payment/account/controller.py

+ 6 - 3
backend/app/plugin/module_payment/account/controller.py

@@ -617,6 +617,9 @@ async def start_retry_scheduler():
 
 @AccountRouter.on_event("shutdown")
 async def stop_retry_scheduler():
-    if scheduler.running:
-        scheduler.shutdown(wait=False)
-        log.info("[重试任务] 定时任务已停止")
+    try:
+        if scheduler.running:
+            scheduler.shutdown(wait=False)
+            log.info("[重试任务] 定时任务已停止")
+    except Exception:
+        pass