Cron jobs
Scheduling tasks for certain periods or intervals.
yarn add @nestjs/schedulenest g mo cron
nest g s cronyarn add date-fnsconst oneMonthAgo = sub(new Date(), { months: 1 });const users = await this.usersRepository.find({
where: {
registryDates: { deletedAt: LessThan(oneMonthAgo) },
},
withDeleted: true,
});
await this.usersRepository.remove(users);Last updated