feat: add user submission functionality
This commit is contained in:
@@ -2,7 +2,7 @@ import { HttpStatus, Injectable, UnauthorizedException } from '@nestjs/common';
|
||||
import { LessThan, MoreThanOrEqual, Repository } from 'typeorm';
|
||||
import { OTP } from '../entities/otp.entity';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Cron } from '@nestjs/schedule';
|
||||
import { Cron, CronExpression } from '@nestjs/schedule';
|
||||
import { HashingProvider } from '@/common/modules/hashing/providers/hashing.provider';
|
||||
import { AppException } from '@/common/exceptions/app.exception';
|
||||
import { AppTimeoutException } from '@/common/exceptions/app-timeout.exception';
|
||||
@@ -86,7 +86,7 @@ export class OtpService {
|
||||
return otp;
|
||||
}
|
||||
|
||||
@Cron('0 */10 * * * *')
|
||||
@Cron(CronExpression.EVERY_10_MINUTES)
|
||||
public async cleanupExpired(): Promise<void> {
|
||||
await this.otpRepository.delete({
|
||||
expiresAt: LessThan(new Date()),
|
||||
|
||||
Reference in New Issue
Block a user