mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 17:15:03 -07:00
optimizations
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user