mirror of
https://github.com/whyour/qinglong.git
synced 2026-08-05 08:14:32 +08:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2c57ada739 | |||
| 87a1a3d2eb | |||
| 99064bde10 |
@@ -350,6 +350,11 @@ export default class SubscriptionService {
|
||||
for (const doc of docs) {
|
||||
await this.handleTask(doc.get({ plain: true }), false);
|
||||
}
|
||||
// Disable associated cron tasks
|
||||
const crons = await CrontabModel.findAll({ where: { sub_id: ids } });
|
||||
if (crons?.length) {
|
||||
await this.crontabService.disabled(crons.map((x) => x.id!));
|
||||
}
|
||||
}
|
||||
|
||||
public async enabled(ids: number[]) {
|
||||
@@ -359,6 +364,11 @@ export default class SubscriptionService {
|
||||
for (const doc of docs) {
|
||||
await this.handleTask(doc.get({ plain: true }));
|
||||
}
|
||||
// Enable associated cron tasks
|
||||
const crons = await CrontabModel.findAll({ where: { sub_id: ids } });
|
||||
if (crons?.length) {
|
||||
await this.crontabService.enabled(crons.map((x) => x.id!));
|
||||
}
|
||||
}
|
||||
|
||||
public async log(id: number) {
|
||||
|
||||
Reference in New Issue
Block a user