Skip to content

Commit

Permalink
修复订阅任务创建逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
whyour committed May 29, 2022
1 parent b55c7d5 commit 706b5e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 6 additions & 1 deletion back/loaders/initTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
}
};
3 changes: 1 addition & 2 deletions back/services/subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ export default class SubscriptionService {

public async update(payload: Subscription): Promise<Subscription> {
const newDoc = await this.updateDb(payload);
await this.handleTask(newDoc);
await this.handleTask(newDoc, !newDoc.is_disabled);
return newDoc;
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 706b5e8

Please sign in to comment.