mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2024-11-01 22:20:30 +08:00
定时任务不主动停止
This commit is contained in:
parent
edc1383843
commit
63b290ba9f
@ -311,13 +311,13 @@ export class TaskInfoService extends BaseService {
|
|||||||
const task = await this.taskInfoEntity.findOneBy({ id: job.id });
|
const task = await this.taskInfoEntity.findOneBy({ id: job.id });
|
||||||
const nextTime = await this.getNextRunTime(task.id);
|
const nextTime = await this.getNextRunTime(task.id);
|
||||||
if (task) {
|
if (task) {
|
||||||
if (task.nextRunTime.getTime() == nextTime.getTime()) {
|
// if (task.nextRunTime.getTime() == nextTime.getTime()) {
|
||||||
task.status = 0;
|
// task.status = 0;
|
||||||
task.nextRunTime = nextTime;
|
// task.nextRunTime = nextTime;
|
||||||
this.taskInfoQueue.removeRepeatableByKey(job.key);
|
// this.taskInfoQueue.removeRepeatableByKey(job.key);
|
||||||
} else {
|
// } else {
|
||||||
task.nextRunTime = nextTime;
|
task.nextRunTime = nextTime;
|
||||||
}
|
// }
|
||||||
await this.taskInfoEntity.update(task.id, task);
|
await this.taskInfoEntity.update(task.id, task);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user