From fe25f8f48f0b52e403fe65dd81834eabce813e03 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 15 May 2025 07:12:52 +0800 Subject: [PATCH] fix #4277 --- app/startup/lifecycle.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/startup/lifecycle.py b/app/startup/lifecycle.py index 6fd8978d..4974c9a4 100644 --- a/app/startup/lifecycle.py +++ b/app/startup/lifecycle.py @@ -34,6 +34,8 @@ async def lifespan(app: FastAPI): init_modules() # 初始化路由 init_routers(app) + # 初始化插件 + init_plugins() # 初始化定时器 init_scheduler() # 初始化监控器 @@ -42,8 +44,6 @@ async def lifespan(app: FastAPI): init_command() # 初始化工作流 init_workflow() - # 初始化插件 - init_plugins() # 插件同步到本地 sync_plugins_task = asyncio.create_task(init_plugin_system()) try: @@ -60,8 +60,6 @@ async def lifespan(app: FastAPI): pass except Exception as e: print(str(e)) - # 停止插件 - stop_plugins() # 停止工作流 stop_workflow() # 停止命令 @@ -70,5 +68,7 @@ async def lifespan(app: FastAPI): stop_monitor() # 停止定时器 stop_scheduler() + # 停止插件 + stop_plugins() # 停止模块 stop_modules()