mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2025-04-13 06:19:26 +02:00
bug
This commit is contained in:
parent
326a5a7b33
commit
f8d1c61c1c
@ -42,6 +42,10 @@ export class ClientStatisticsService {
|
||||
}
|
||||
|
||||
public async doBulkAsyncUpdate(){
|
||||
if(this.bulkAsyncUpdates.length < 1){
|
||||
console.log('No client stats to update.')
|
||||
return;
|
||||
}
|
||||
// Step 1: Prepare data for bulk update
|
||||
const values = this.bulkAsyncUpdates.map(stat =>
|
||||
`('${stat.clientId}', ${stat.time}, ${stat.shares ?? 0}, ${stat.acceptedCount ?? 0}, NOW())`
|
||||
@ -73,6 +77,7 @@ export class ClientStatisticsService {
|
||||
|
||||
try {
|
||||
await this.clientStatisticsRepository.query(query);
|
||||
console.log(`Bulk updated ${this.bulkAsyncUpdates.length} statistics`)
|
||||
} catch (error) {
|
||||
console.error('Bulk update failed:', error.message, query);
|
||||
throw error;
|
||||
|
Loading…
x
Reference in New Issue
Block a user