清除临时文件,防止重复处理。
This commit is contained in:
@@ -10,6 +10,7 @@ import traceback
|
|||||||
|
|
||||||
from wcferry import Wcf
|
from wcferry import Wcf
|
||||||
|
|
||||||
|
from db.connection import DBConnectionManager
|
||||||
from plugin_common.plugin_interface import PluginStatus
|
from plugin_common.plugin_interface import PluginStatus
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -328,7 +329,7 @@ class KidPhotoExtractorPlugin(MessagePluginInterface):
|
|||||||
self.wcf = context.get("wcf")
|
self.wcf = context.get("wcf")
|
||||||
self.event_system = context.get("event_system")
|
self.event_system = context.get("event_system")
|
||||||
self.message_util = context.get("message_util")
|
self.message_util = context.get("message_util")
|
||||||
self.db_manager = context.get("db_manager")
|
self.db_manager = DBConnectionManager.get_instance()
|
||||||
|
|
||||||
# 初始化数据库
|
# 初始化数据库
|
||||||
if self.db_manager:
|
if self.db_manager:
|
||||||
@@ -746,6 +747,9 @@ class KidPhotoExtractorPlugin(MessagePluginInterface):
|
|||||||
self.LOG.error(traceback.format_exc())
|
self.LOG.error(traceback.format_exc())
|
||||||
wcf.send_text(f"❌分析过程中出错: {str(e)}", target, sender)
|
wcf.send_text(f"❌分析过程中出错: {str(e)}", target, sender)
|
||||||
finally:
|
finally:
|
||||||
|
# 清理所有临时文件
|
||||||
|
self._cleanup_temp_files(temp_files)
|
||||||
|
|
||||||
# 标记任务完成
|
# 标记任务完成
|
||||||
self.analysis_tasks[group_key]["running"] = False
|
self.analysis_tasks[group_key]["running"] = False
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user