mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
bug
This commit is contained in:
@@ -33,7 +33,14 @@ export class ClientStatisticsService {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
public updateBulkAsync(clientStatistic: Partial<ClientStatisticsEntity>) {
|
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(){
|
public async doBulkAsyncUpdate(){
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ export class AppService implements OnModuleInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setInterval(async () => {
|
setInterval(async () => {
|
||||||
console.log('Bulk update client stats');
|
//console.log('Bulk update client stats');
|
||||||
await this.clientStatisticsService.doBulkAsyncUpdate();
|
await this.clientStatisticsService.doBulkAsyncUpdate();
|
||||||
}, 1000 * 60 * 1);
|
}, 1000 * 60 * 1);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user