NestJS has added a waitForCompletion
option in version 5.0.1.
https://github.com/nestjs/schedule/pull/1870
@Cron(CronExpression.EVERY_SECOND, {
waitForCompletion: true,
})
async handleCron() {
this.logger.debug(`start ${c}`);
await timeout(3000)
this.logger.debug(`end ${c}`);
c += 1;
}