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

Auto archive items older than 90 days #193

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

michellejli77
Copy link
Contributor

@michellejli77 michellejli77 commented Jan 28, 2023

Description

Motivation/Context: In order to decrease the number of items stored in our database, we want to automatically archive items that have been on the page for more than 90 days.

  • Create a helper async function to find all active items older than 90 days (added to DB over 90 days ago) and archive them
  • Create a cron job that runs this function once a week

Closes #177

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Check that the cron job automatically runs by logging calls on console
  • Confirm that cron scheduler is calling the auto archive function
  • Check that all active items older than 90 days are moved to archive
  • Check that all active items younger than 90 days are not impacted
  • Check that the "Archiver" dropdown says "Automatically Archived on ..."

Test Configuration:

  • Node.js version: 14.18.0
  • Desktop/Mobile: Desktop
  • Browser: Chrome

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

api/routes/items.ts Show resolved Hide resolved
api/routes/items.ts Show resolved Hide resolved
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.

[Feature] Automatic archive for all items older than 90 days
2 participants