mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2025-03-27 02:02:10 +01:00
keep statistics for a 8 days
This commit is contained in:
parent
42235736fa
commit
31d4069e18
@ -33,13 +33,13 @@ export class ClientStatisticsService {
|
||||
}
|
||||
|
||||
public async deleteOldStatistics() {
|
||||
const oneDayAgo = new Date(Date.now() - 24 * 60 * 60 * 1000);
|
||||
const eightDays = new Date(Date.now() - 8 * 24 * 60 * 60 * 1000);
|
||||
|
||||
return await this.clientStatisticsRepository
|
||||
.createQueryBuilder()
|
||||
.delete()
|
||||
.from(ClientStatisticsEntity)
|
||||
.where('time < :time', { time: oneDayAgo.getTime() })
|
||||
.where('time < :time', { time: eightDays.getTime() })
|
||||
.execute();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user