mirror of
https://github.com/whyour/qinglong.git
synced 2026-08-11 19:05:20 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c57ada739 | ||
|
|
87a1a3d2eb | ||
|
|
99064bde10 |
@@ -350,6 +350,11 @@ export default class SubscriptionService {
|
|||||||
for (const doc of docs) {
|
for (const doc of docs) {
|
||||||
await this.handleTask(doc.get({ plain: true }), false);
|
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[]) {
|
public async enabled(ids: number[]) {
|
||||||
@@ -359,6 +364,11 @@ export default class SubscriptionService {
|
|||||||
for (const doc of docs) {
|
for (const doc of docs) {
|
||||||
await this.handleTask(doc.get({ plain: true }));
|
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) {
|
public async log(id: number) {
|
||||||
|
|||||||
Reference in New Issue
Block a user