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
[x] New feature (non-breaking change which adds functionality)
How Has This Been Tested?
[x] Check that the cron job automatically runs by logging calls on console
[x] Confirm that cron scheduler is calling the auto archive function
[x] Check that all active items older than 90 days are moved to archive
[x] Check that all active items younger than 90 days are not impacted
[x] Check that the "Archiver" dropdown says "Automatically Archived on ..."
Test Configuration:
Node.js version: 14.18.0
Desktop/Mobile: Desktop
Browser: Chrome
Checklist:
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my code
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[x] 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
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.
Closes #177
Type of change
How Has This Been Tested?
Test Configuration:
Checklist: