Skip to content
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

feat: add autodelete outdated time blocks #36

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

KevDev0247
Copy link
Contributor

What does this PR do?

Add autodelete for outdated time blocks

Checklist

  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • My changes generate no new warnings
  • My merge commit message follows Conventional Commits

// Scheduling an autodelete task that runs every day at 00:00
schedule.scheduleJob('*0 0 * * *', async function () {
const currDate = new Date();
currDate.setDate(currDate.getDate() - 7);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-7 will not work if it's the same month, I'd use the already imported Luxon's ability to compare between dates. Also I would just call it date and not currDate because it's a week ago

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants