From 8e20e2656523bee8679f2044beeedd16ff960553 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 5 Jun 2025 14:07:31 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E6=8D=95=E6=8D=89=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E5=81=9C=E6=AD=A2=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/core/plugin.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/core/plugin.py b/app/core/plugin.py index afa18031..96065b17 100644 --- a/app/core/plugin.py +++ b/app/core/plugin.py @@ -295,12 +295,15 @@ class PluginManager(metaclass=Singleton): 停止插件 :param plugin: 插件实例 """ - # 关闭数据库 - if hasattr(plugin, "close"): - plugin.close() - # 关闭插件 - if hasattr(plugin, "stop_service"): - plugin.stop_service() + try: + # 关闭数据库 + if hasattr(plugin, "close"): + plugin.close() + # 关闭插件 + if hasattr(plugin, "stop_service"): + plugin.stop_service() + except Exception as e: + logger.warn(f"停止插件 {plugin.get_name()} 时发生错误: {str(e)}") def remove_plugin(self, plugin_id: str): """