From 9cea0fa3cee7515e62ff98ebde3fe7558eae9cd6 Mon Sep 17 00:00:00 2001 From: filesite Date: Sat, 13 Apr 2024 23:28:33 +0800 Subject: [PATCH] improve task data save --- heroUnion.mjs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/heroUnion.mjs b/heroUnion.mjs index ea69aa3..697284e 100644 --- a/heroUnion.mjs +++ b/heroUnion.mjs @@ -271,14 +271,7 @@ class HeroUnion { } data.provider = bot_name; //记录数据提供者 - - let resIndex = this.tasks[taskIndex].results.findIndex((dataItem) => dataItem.provider == bot_name); - if (resIndex == -1) { - this.tasks[taskIndex].results.push(data); - }else { - this.tasks[taskIndex].results[resIndex] = data; - } - + this.tasks[taskIndex].results = data; this.tasks[taskIndex].updated = common.getTimestampInSeconds(); //更新统计数据