delete old stats sooner

This commit is contained in:
Ben Wilson 2023-12-07 09:57:20 -05:00
parent 6cf6a007d9
commit f7b22bb310

View File

@ -33,13 +33,13 @@ export class ClientStatisticsService {
}
public async deleteOldStatistics() {
const eightDays = new Date(Date.now() - 8 * 24 * 60 * 60 * 1000);
const oneDayAgo = new Date(Date.now() - 24 * 60 * 60 * 1000);
return await this.clientStatisticsRepository
.createQueryBuilder()
.delete()
.from(ClientStatisticsEntity)
.where('time < :time', { time: eightDays.getTime() })
.where('time < :time', { time: oneDayAgo.getTime() })
.execute();
}