optimizations

This commit is contained in:
Ben Wilson
2023-08-04 16:34:49 -04:00
parent 6423e2cb67
commit f85967daf8
6 changed files with 55 additions and 17 deletions
+17 -2
View File
@@ -17,10 +17,25 @@ export class ClientService {
}
public async save(client: Partial<ClientEntity>) {
return await this.clientRepository.save(client);
// public async killDeadClients(){
// var tenMinutes = new Date(new Date().getTime() - (60 * 60 * 1000));
// return await this.clientRepository.update({
// deletedAt: IsNull(),
// updatedAt: LessThan(tenMinutes)
// }, {
// deletedAt: new Date()
// });
// }
public async heartbeat(address: string, clientName: string, sessionId: string) {
return await this.clientRepository.update({ address, clientName, sessionId }, { deletedAt: null, updatedAt: new Date() });
}
// public async save(client: Partial<ClientEntity>) {
// return await this.clientRepository.save(client);
// }
public async insert(partialClient: Partial<ClientEntity>): Promise<ClientEntity> {
const insertResult = await this.clientRepository.insert(partialClient);