From ee6e5bd8b4da956dd6e6bff9b4df352637008da0 Mon Sep 17 00:00:00 2001 From: whyour Date: Sun, 2 Jul 2023 16:09:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=BB=E5=8A=A1=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/data/cron.ts | 6 +++--- back/loaders/initData.ts | 2 +- src/pages/crontab/type.ts | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/back/data/cron.ts b/back/data/cron.ts index 3fc7fe4e..faf81bf6 100644 --- a/back/data/cron.ts +++ b/back/data/cron.ts @@ -43,9 +43,9 @@ export class Crontab { } export enum CrontabStatus { - 'running', - 'queued', - 'idle', + 'running' = 0, + 'queued' = 0.5, + 'idle' = 1, 'disabled', } diff --git a/back/loaders/initData.ts b/back/loaders/initData.ts index 3b6dfc07..e680d58e 100644 --- a/back/loaders/initData.ts +++ b/back/loaders/initData.ts @@ -32,7 +32,7 @@ export default async () => { // 初始化更新所有任务状态为空闲 await CrontabModel.update( { status: CrontabStatus.idle }, - { where: { status: { [Op.ne]: CrontabStatus.disabled } } }, + { where: {} }, ); // 初始化时安装所有处于安装中,安装成功,安装失败的依赖 diff --git a/src/pages/crontab/type.ts b/src/pages/crontab/type.ts index cdc8f175..9be2d2ed 100644 --- a/src/pages/crontab/type.ts +++ b/src/pages/crontab/type.ts @@ -1,7 +1,7 @@ export enum CrontabStatus { - 'running', - 'queued', - 'idle', + 'running' = 0, + 'queued' = 0.5, + 'idle' = 1, 'disabled', }