From 1585ab564d547f0ec7eeba19362e1aafe533fb98 Mon Sep 17 00:00:00 2001 From: DLmaster361 Date: Tue, 16 Sep 2025 21:04:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AE=BE=E7=BD=AE=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E6=97=B6=E4=B8=8D=E5=86=8D=E6=A3=80=E6=B5=8B=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E7=8A=B6=E6=80=81=EF=BC=8C=E7=94=B1=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=89=8B=E5=8A=A8=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/core/task_manager.py | 1 - app/task/MAA.py | 16 +--------------- app/task/general.py | 14 +------------- 3 files changed, 2 insertions(+), 29 deletions(-) diff --git a/app/core/task_manager.py b/app/core/task_manager.py index 995eb8c..de0be98 100644 --- a/app/core/task_manager.py +++ b/app/core/task_manager.py @@ -76,7 +76,6 @@ class _TaskManager: if task_id in self.task_dict or ( actual_id is not None and actual_id in self.task_dict ): - raise RuntimeError(f"任务 {task_id} 已在运行") logger.info(f"创建任务: {task_id}, 模式: {mode}") diff --git a/app/task/MAA.py b/app/task/MAA.py index 458d96f..95d625e 100644 --- a/app/task/MAA.py +++ b/app/task/MAA.py @@ -862,15 +862,10 @@ class MaaManager: # 创建MAA任务 logger.info(f"启动MAA进程: {self.maa_exe_path}") await self.maa_process_manager.open_process(self.maa_exe_path, [], 0) - # 记录当前时间 - self.log_start_time = datetime.now() - # 监测MAA运行状态 - self.log_check_mode = "设置脚本" - await self.maa_log_monitor.start(self.maa_log_path, self.log_start_time) + # 等待用户完成配置 self.wait_event.clear() await self.wait_event.wait() - await self.maa_log_monitor.stop() async def result_record(self): """记录用户结果信息""" @@ -1297,15 +1292,6 @@ class MaaManager: else: self.maa_result = "Wait" - elif self.mode == "设置脚本": - if ( - "MaaAssistantArknights GUI exited" in log - or not await self.maa_process_manager.is_running() - ): - self.maa_result = "Success!" - else: - self.maa_result = "Wait" - logger.debug(f"MAA 日志分析结果: {self.maa_result}") if self.maa_result != "Wait": diff --git a/app/task/general.py b/app/task/general.py index 599b184..ffdeee2 100644 --- a/app/task/general.py +++ b/app/task/general.py @@ -529,16 +529,10 @@ class GeneralManager: 60 if self.script_config.get("Script", "IfTrackProcess") else 0 ), ) - # 记录当前时间 - self.log_start_time = datetime.now() - # 监测MAA运行状态 - await self.general_log_monitor.start( - self.script_log_path, self.log_start_time - ) + # 等待用户完成配置 self.wait_event.clear() await self.wait_event.wait() - await self.general_log_monitor.stop() async def result_record(self) -> None: """记录用户结果信息""" @@ -821,12 +815,6 @@ class GeneralManager: else: self.general_result = "Success!" - elif self.mode == "设置通用脚本": - if await self.general_process_manager.is_running(): - self.general_result = "Wait" - else: - self.general_result = "Success!" - logger.info(f"通用脚本日志分析结果: {self.general_result}") if self.general_result != "Wait":