From 48c508f72585d45d6bffbdf3664ab174bd66cedb Mon Sep 17 00:00:00 2001 From: liuwei Date: Mon, 14 Apr 2025 12:25:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E9=99=A4=E4=B8=B4=E6=97=B6=E6=96=87?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E9=98=B2=E6=AD=A2=E9=87=8D=E5=A4=8D=E5=A4=84?= =?UTF-8?q?=E7=90=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/kid_photo_extractor/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/kid_photo_extractor/main.py b/plugins/kid_photo_extractor/main.py index d7f6f08..4e8fe58 100644 --- a/plugins/kid_photo_extractor/main.py +++ b/plugins/kid_photo_extractor/main.py @@ -10,6 +10,7 @@ import traceback from wcferry import Wcf +from db.connection import DBConnectionManager from plugin_common.plugin_interface import PluginStatus try: @@ -328,7 +329,7 @@ class KidPhotoExtractorPlugin(MessagePluginInterface): self.wcf = context.get("wcf") self.event_system = context.get("event_system") self.message_util = context.get("message_util") - self.db_manager = context.get("db_manager") + self.db_manager = DBConnectionManager.get_instance() # 初始化数据库 if self.db_manager: @@ -746,6 +747,9 @@ class KidPhotoExtractorPlugin(MessagePluginInterface): self.LOG.error(traceback.format_exc()) wcf.send_text(f"❌分析过程中出错: {str(e)}", target, sender) finally: + # 清理所有临时文件 + self._cleanup_temp_files(temp_files) + # 标记任务完成 self.analysis_tasks[group_key]["running"] = False