From 7b7d62760e258b651d64f378b03a71aa44b2bcc8 Mon Sep 17 00:00:00 2001 From: hanhh <18330117883@163.com> Date: Sun, 4 Jul 2021 19:35:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E4=B8=BA=E7=A9=BA=E9=97=B2=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/loaders/initData.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/back/loaders/initData.ts b/back/loaders/initData.ts index 243e9513..f96b695f 100644 --- a/back/loaders/initData.ts +++ b/back/loaders/initData.ts @@ -45,16 +45,11 @@ export default async () => { } }); - // patch更新面板任务状态 - cronDb.find({ name: '更新面板' }).exec((err, docs) => { - const doc = docs[0]; - if (doc && doc.status === CrontabStatus.running) { - cronDb.update( - { name: '更新面板' }, - { $set: { status: CrontabStatus.idle } }, - ); - } - }); + // 初始化更新所有任务状态为空闲 + cronDb.update( + { status: CrontabStatus.running }, + { $set: { status: CrontabStatus.idle } }, + ); // 初始化时执行一次所有的ql repo 任务 cronDb