From d34afdb692e1c241db505b39e6880994e1e48f9f Mon Sep 17 00:00:00 2001 From: filesite Date: Thu, 6 Jun 2024 06:50:20 +0800 Subject: [PATCH] bug fix for failed task repeat query result --- monitor.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/monitor.mjs b/monitor.mjs index 1069f19..c17afb0 100644 --- a/monitor.mjs +++ b/monitor.mjs @@ -101,7 +101,7 @@ class Monitor { let task, taskRes; for(let index = 0; index < _self.tasks.length; index ++) { task = _self.tasks[index]; - if (task.status == 'done') {continue;} + if (task.status == 'done' || task.status == 'failed') {continue;} taskRes = await common.queryHeroUnionTask(task.id, configs); if (taskRes && taskRes.code == 1) { @@ -142,8 +142,8 @@ class Monitor { } } - //更新tasks,去掉已完成的 - _self.tasks = _self.tasks.filter((item) => item.status != 'done'); + //更新tasks,去掉已完成的和失败的 + _self.tasks = _self.tasks.filter((item) => item.status != 'done' && item.status != 'failed'); } //自动查询监控任务结果