mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 17:15:03 -07:00
cleanup and support for all address types
This commit is contained in:
@@ -25,6 +25,19 @@ export class ClientService {
|
||||
return await this.clientRepository.softDelete({ sessionId });
|
||||
}
|
||||
|
||||
public async deleteOldClients() {
|
||||
|
||||
const oneDayAgo = new Date(Date.now() - 24 * 60 * 60 * 1000);
|
||||
|
||||
return await this.clientRepository
|
||||
.createQueryBuilder()
|
||||
.delete()
|
||||
.from(ClientEntity)
|
||||
.where('deletedAt < :time', { time: oneDayAgo })
|
||||
.execute();
|
||||
|
||||
}
|
||||
|
||||
public async updateBestDifficulty(sessionId: string, bestDifficulty: number) {
|
||||
return await this.clientRepository.update({ sessionId }, { bestDifficulty });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user