From 8584c442dcb9c4c559312c93cb8f7ecd513afee2 Mon Sep 17 00:00:00 2001 From: Benjamin Wilson Date: Wed, 26 Feb 2025 17:07:04 -0500 Subject: [PATCH] bug --- src/ORM/client-statistics/client-statistics.service.ts | 9 ++++++++- src/services/app.service.ts | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ORM/client-statistics/client-statistics.service.ts b/src/ORM/client-statistics/client-statistics.service.ts index 1d70650..1e19e5c 100644 --- a/src/ORM/client-statistics/client-statistics.service.ts +++ b/src/ORM/client-statistics/client-statistics.service.ts @@ -33,7 +33,14 @@ export class ClientStatisticsService { // } public updateBulkAsync(clientStatistic: Partial) { - this.bulkAsyncUpdates[clientStatistic.client + clientStatistic.time.toString()] = clientStatistic; + const key = clientStatistic.clientId + clientStatistic.time.toString(); + if(this.bulkAsyncUpdates[key] != null){ + this.bulkAsyncUpdates[key].shares = clientStatistic.shares; + this.bulkAsyncUpdates[key].acceptedCount = clientStatistic.acceptedCount; + return; + } + + this.bulkAsyncUpdates[clientStatistic.clientId + clientStatistic.time.toString()] = clientStatistic; } public async doBulkAsyncUpdate(){ diff --git a/src/services/app.service.ts b/src/services/app.service.ts index 1e6217c..0459496 100644 --- a/src/services/app.service.ts +++ b/src/services/app.service.ts @@ -51,7 +51,7 @@ export class AppService implements OnModuleInit { } setInterval(async () => { - console.log('Bulk update client stats'); + //console.log('Bulk update client stats'); await this.clientStatisticsService.doBulkAsyncUpdate(); }, 1000 * 60 * 1);