From 74f5783dc310f5cb1ebb677747ada31435576603 Mon Sep 17 00:00:00 2001 From: Benjamin Wilson Date: Wed, 26 Feb 2025 00:24:34 -0500 Subject: [PATCH] logging --- src/services/stratum-v1.service.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/services/stratum-v1.service.ts b/src/services/stratum-v1.service.ts index e16f9e9..7dd8660 100644 --- a/src/services/stratum-v1.service.ts +++ b/src/services/stratum-v1.service.ts @@ -46,6 +46,13 @@ export class StratumV1Service implements OnModuleInit { }); }, (10000)); + setInterval(() => { + console.log(`Socket stats: ${this.emptySocket} empty, ${this.socketTimeout} timeouts, ${this.normalClosure} normal closure, ${this.errorClosure} error closure`); + this.emptySocket = 0; + this.socketTimeout = 0; + this.normalClosure = 0; + this.errorClosure = 0; + }, 1000 * 60); } @@ -116,13 +123,7 @@ export class StratumV1Service implements OnModuleInit { console.log(`Stratum server is listening on port ${port}`); }); - setInterval(() => { - console.log(`Socket stats: ${this.emptySocket} empty, ${this.socketTimeout} timeouts, ${this.normalClosure} normal closure, ${this.errorClosure} error closure`); - this.emptySocket = 0; - this.socketTimeout = 0; - this.normalClosure = 0; - this.errorClosure = 0; - }, 1000 * 60); + }