mirror of
https://github.com/certd/certd.git
synced 2026-05-16 13:17:29 +08:00
fix: 修复在相同的cron时偶尔无法触发定时任务的bug
This commit is contained in:
@@ -120,7 +120,7 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
}
|
||||
}
|
||||
}
|
||||
logger.info('定时器数量:', this.cron.getListSize());
|
||||
logger.info('定时器数量:', this.cron.getTaskSize());
|
||||
}
|
||||
|
||||
async registerTriggers(pipeline?: Pipeline, immediateTriggerOnce = false) {
|
||||
@@ -193,7 +193,7 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
}
|
||||
},
|
||||
});
|
||||
logger.info('当前定时器数量:', this.cron.getListSize());
|
||||
logger.info('当前定时器数量:', this.cron.getTaskSize());
|
||||
}
|
||||
|
||||
async run(id: number, triggerId: string) {
|
||||
@@ -212,6 +212,7 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
const onChanged = async (history: RunHistory) => {
|
||||
//保存执行历史
|
||||
try {
|
||||
logger.info('保存执行历史:', history.id);
|
||||
await this.saveHistory(history);
|
||||
} catch (e) {
|
||||
const pipelineEntity = new PipelineEntity();
|
||||
|
||||
Reference in New Issue
Block a user