From 9d8c592e694e637ed833c2f085ce37601b2f746e Mon Sep 17 00:00:00 2001 From: hanhh <18330117883@163.com> Date: Sat, 17 Jul 2021 00:01:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/back/loaders/initData.ts b/back/loaders/initData.ts index f96b695f..732c5d64 100644 --- a/back/loaders/initData.ts +++ b/back/loaders/initData.ts @@ -47,19 +47,21 @@ export default async () => { // 初始化更新所有任务状态为空闲 cronDb.update( - { status: CrontabStatus.running }, + { status: { $in: [CrontabStatus.running, CrontabStatus.queued] } }, { $set: { status: CrontabStatus.idle } }, + { multi: true }, ); // 初始化时执行一次所有的ql repo 任务 cronDb .find({ command: /ql (repo|raw)/, + isDisabled: { $ne: 1 }, }) .exec((err, docs) => { for (let i = 0; i < docs.length; i++) { const doc = docs[i]; - if (doc && doc.isDisabled !== 1) { + if (doc) { exec(doc.command); } }