import { Injectable } from '@nestjs/common';
import { Cron } from '@nestjs/schedule';
// other imports
@Injectable()
export class ClassNameJob {
constructor(private readonly xxxService: XxxService) {
}
@Cron(CronConstants.AT_EVERY_2TH_MINUTE)
async methodName(userId?: number) {
// ... code
}
}
Need some help with, I didn't find the solution yet. Will be helpful if someone had similar issue and solve it.