chore: pipeline valid time add to plus

This commit is contained in:
xiaojunnuo
2025-10-23 00:14:31 +08:00
parent 3b690cc31f
commit 1505d04622
@@ -485,6 +485,17 @@ export class PipelineService extends BaseService<PipelineEntity> {
logger.info("当前定时器数量:", this.cron.getTaskSize()); logger.info("当前定时器数量:", this.cron.getTaskSize());
} }
async isPipelineValidTimeEnabled(entity: PipelineEntity) {
const settings = await this.sysSettingsService.getPublicSettings();
if (isPlus() && settings.pipelineValidTimeEnabled){
if (entity.validTime > 0 && entity.validTime < Date.now()){
return false
}
}
return true
}
/** /**
* *
* @param id * @param id
@@ -493,7 +504,9 @@ export class PipelineService extends BaseService<PipelineEntity> {
*/ */
async run(id: number, triggerId: string, stepId?: string) { async run(id: number, triggerId: string, stepId?: string) {
const entity: PipelineEntity = await this.info(id); const entity: PipelineEntity = await this.info(id);
if (entity.validTime > 0 && entity.validTime < Date.now()) { const validTimeEnabled = await this.isPipelineValidTimeEnabled(entity)
if (!validTimeEnabled) {
logger.info(`流水线${id}已过期,不予执行`);
return; return;
} }
await this.doRun(entity, triggerId, stepId); await this.doRun(entity, triggerId, stepId);