From 24538d34ce3918e9b112c140314b9f3ca3a04544 Mon Sep 17 00:00:00 2001 From: Ben Wilson Date: Sun, 6 Aug 2023 17:45:30 -0400 Subject: [PATCH] remove logging --- src/ORM/client/client.service.ts | 4 ++-- src/models/StratumV1Client.ts | 7 +------ src/services/app.service.ts | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/ORM/client/client.service.ts b/src/ORM/client/client.service.ts index cffbb04..e68899a 100644 --- a/src/ORM/client/client.service.ts +++ b/src/ORM/client/client.service.ts @@ -20,13 +20,13 @@ export class ClientService { public async killDeadClients() { - var tenMinutes = new Date(new Date().getTime() - (10 * 60 * 1000)).toISOString(); + var fiveMinutes = new Date(new Date().getTime() - (5 * 60 * 1000)).toISOString(); return await this.clientRepository .createQueryBuilder() .update(ClientEntity) .set({ deletedAt: () => "DATETIME('now')" }) - .where("deletedAt IS NULL AND updatedAt < :tenMinutes", { tenMinutes }) + .where("deletedAt IS NULL AND updatedAt < :fiveMinutes", { fiveMinutes }) .execute(); } diff --git a/src/models/StratumV1Client.ts b/src/models/StratumV1Client.ts index 5d8fa2b..6e3410a 100644 --- a/src/models/StratumV1Client.ts +++ b/src/models/StratumV1Client.ts @@ -98,7 +98,7 @@ export class StratumV1Client { private async handleMessage(message: string) { - console.log(`Received from ${this.extraNonceAndSessionId}`, message); + // console.log(`Received from ${this.extraNonceAndSessionId}`, message); // Parse the message and check if it's the initial subscription message let parsedMessage = null; @@ -201,10 +201,7 @@ export class StratumV1Client { if (errors.length === 0) { this.clientAuthorization = authorizationMessage; - console.log('AUTH START'); - //const response = this.buildSubscriptionResponse(authorizationMessage.id); const success = await this.write(JSON.stringify(this.clientAuthorization.response()) + '\n'); - console.log('AUTH FIN'); if (!success) { return; } @@ -305,7 +302,6 @@ export class StratumV1Client { } } - console.log('test') if (this.clientSubscription != null && this.clientAuthorization != null @@ -563,7 +559,6 @@ export class StratumV1Client { } private async write(message: string): Promise { - console.log(message) try { if (!this.socket.destroyed && !this.socket.writableEnded) { diff --git a/src/services/app.service.ts b/src/services/app.service.ts index a0e9a61..1202315 100644 --- a/src/services/app.service.ts +++ b/src/services/app.service.ts @@ -36,7 +36,7 @@ export class AppService implements OnModuleInit { } } - @Cron(CronExpression.EVERY_10_MINUTES) + @Cron(CronExpression.EVERY_5_MINUTES) private async killDeadClients() { if (process.env.NODE_APP_INSTANCE == null || process.env.NODE_APP_INSTANCE == '0') {