-
-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: create a cron job function that will run every hour to clean up expired otps #73
chore: create a cron job function that will run every hour to clean up expired otps #73
Conversation
PR Description updated to latest commit (5ffb54d) |
PR Analysis
PR Feedback💡 General suggestions: The PR is well-structured and the code changes are clear. However, it would be beneficial to add tests to ensure the new cron job and the 🤖 Code feedback:
✨ Usage tips:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice to me. I'll review this tomorrow morning and merge it!
🎉 This PR is included in version 1.0.0-alpha.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Type
enhancement
Description
This PR introduces a new feature to clean up expired OTPs from the database. The main changes include:
deleteExpiredOtps
has been added to theAuthRepository
,IAuthRepository
, andMockAuthRepository
to delete expired OTPs.cleanUpExpiredOtps
has been added to theAuthService
that runs every hour to delete expired OTPs.@nestjs/schedule
package has been added as a new dependency to handle scheduling tasks.PR changes walkthrough
4 files
auth.repository.ts
apps/api/src/auth/repository/auth.repository.ts
Added a new method
deleteExpiredOtps
to delete expiredOTPs from the database.
interface.repository.ts
apps/api/src/auth/repository/interface.repository.ts
Added a new method
deleteExpiredOtps
to theIAuthRepository
interface.mock.repository.ts
apps/api/src/auth/repository/mock.repository.ts
Added a new method
deleteExpiredOtps
to theMockAuthRepository
class.auth.service.ts
apps/api/src/auth/service/auth.service.ts
Added a new cron job
cleanUpExpiredOtps
that runs everyhour to delete expired OTPs.
2 files
package.json
package.json
Added a new dependency
@nestjs/schedule
for schedulingtasks.
pnpm-lock.yaml
pnpm-lock.yaml
Updated the lock file to include the new dependency and its
dependencies.
User description
Description
Create a scheduler to delete expired OTPs.
Fixes #42
Dependencies
@nestjs/schedule
Future Improvements
Mentions
@rajdip-b
Screenshots of relevant screens
Developer's checklist
If changes are made in the code:
Documentation Update