diff --git a/src/class/Queue.ts b/src/class/Queue.ts index 26ec570..647e3a5 100644 --- a/src/class/Queue.ts +++ b/src/class/Queue.ts @@ -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(); + clearOldHistoricalReportsJob.start(); } public async jobCounts() {