fix pgsql

This commit is contained in:
COOL 2025-02-10 16:25:23 +08:00
parent eeccddae35
commit 23002bffd7
2 changed files with 8 additions and 6 deletions

View File

@ -54,9 +54,9 @@ export class TaskInfoEntity extends BaseEntity {
@Column({ comment: '状态 0-cron 1-时间间隔', default: 0 })
taskType: number;
@Column({ type: 'datetime', nullable: true })
@Column({ nullable: true })
lastExecuteTime: Date;
@Column({ type: 'datetime', nullable: true })
@Column({ nullable: true })
lockExpireTime: Date;
}

View File

@ -165,14 +165,16 @@ export class TaskLocalService extends BaseService {
this.cronJobs.delete(params.jobId);
this.coolEventManager.emit('onLocalTaskStop', params.jobId);
}
await this.utils.sleep(1000);
setTimeout(async () => {
this.createCronJob(params);
}, 1000);
}
});
if (params.status === 1) {
await this.utils.sleep(1000);
setTimeout(async () => {
await this.updateNextRunTime(params.jobId);
}, 1000);
}
}