From 026fc436957433d99da85ca189576be66eeff777 Mon Sep 17 00:00:00 2001 From: whyour Date: Sun, 29 May 2022 22:51:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=A2=E9=98=85=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=88=9B=E5=BB=BA=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/loaders/initTask.ts | 7 ++++++- back/services/subscription.ts | 3 +-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/back/loaders/initTask.ts b/back/loaders/initTask.ts index f02c2c00..98feb965 100644 --- a/back/loaders/initTask.ts +++ b/back/loaders/initTask.ts @@ -26,6 +26,11 @@ export default async () => { // 运行所有订阅 const subs = await subscriptionService.list(); for (const sub of subs) { - await subscriptionService.handleTask(sub, true, true, true); + await subscriptionService.handleTask( + sub, + !sub.is_disabled, + true, + !sub.is_disabled, + ); } }; diff --git a/back/services/subscription.ts b/back/services/subscription.ts index adc74438..4718a519 100644 --- a/back/services/subscription.ts +++ b/back/services/subscription.ts @@ -286,7 +286,7 @@ export default class SubscriptionService { public async update(payload: Subscription): Promise { const newDoc = await this.updateDb(payload); - await this.handleTask(newDoc); + await this.handleTask(newDoc, !newDoc.is_disabled); return newDoc; } @@ -360,7 +360,6 @@ export default class SubscriptionService { this.logger.silly(error); } } - await this.handleTask(doc, false); const command = this.formatCommand(doc); const err = await this.killTask(command); const absolutePath = await this.handleLogPath(doc.log_path as string);