清除临时文件,防止重复处理。

This commit is contained in:
liuwei
2025-04-14 12:25:48 +08:00
parent eabf1e5d2c
commit 48c508f725

View File

@@ -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