This commit is contained in:
Benjamin Wilson 2025-02-26 17:07:04 -05:00
parent fd24807c55
commit 8584c442dc
2 changed files with 9 additions and 2 deletions

View File

@ -33,7 +33,14 @@ export class ClientStatisticsService {
// }
public updateBulkAsync(clientStatistic: Partial<ClientStatisticsEntity>) {
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(){

View File

@ -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);