remove Score Historicals older than 30 days

merge-requests/25/merge
Matthew 2021-06-04 22:54:58 -04:00
parent 4ba63caf2e
commit 64d1224a36
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
1 changed files with 5 additions and 0 deletions

View File

@ -43,7 +43,12 @@ export default class Queue {
} }
}); });
const clearOldHistoricalReportsJob = new cron.CronJob('0 20 * * *', async () => {
this.client.db.ScoreHistorical.remove({ date: { $lt: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000) } });
});
historialCommunityReportJob.start(); historialCommunityReportJob.start();
clearOldHistoricalReportsJob.start();
} }
public async jobCounts() { public async jobCounts() {