This commit is contained in:
Benjamin Wilson
2025-02-25 19:27:34 -05:00
parent 903aa2628c
commit 326a5a7b33
2 changed files with 3 additions and 3 deletions
@@ -30,7 +30,7 @@ export class ClientStatisticsService {
// }); // });
// } // }
public async updateBulkAsync(clientStatistic: Partial<ClientStatisticsEntity>, lastSeenIndex: number) { public updateBulkAsync(clientStatistic: Partial<ClientStatisticsEntity>, lastSeenIndex: number) {
if(this.bulkAsyncUpdates.length > lastSeenIndex && this.bulkAsyncUpdates[lastSeenIndex].clientId == clientStatistic.clientId && this.bulkAsyncUpdates[lastSeenIndex].time == clientStatistic.time){ if(this.bulkAsyncUpdates.length > lastSeenIndex && this.bulkAsyncUpdates[lastSeenIndex].clientId == clientStatistic.clientId && this.bulkAsyncUpdates[lastSeenIndex].time == clientStatistic.time){
this.bulkAsyncUpdates[lastSeenIndex].shares = clientStatistic.shares; this.bulkAsyncUpdates[lastSeenIndex].shares = clientStatistic.shares;
+2 -2
View File
@@ -62,7 +62,7 @@ export class StratumV1ClientStatistics {
} else if (this.currentTimeSlot != timeSlot) { } else if (this.currentTimeSlot != timeSlot) {
// Transitioning to a new time slot, // Transitioning to a new time slot,
// First update the old time slot with the latest data // First update the old time slot with the latest data
this.bulkUpdateIndex = await this.clientStatisticsService.updateBulkAsync({ this.bulkUpdateIndex = this.clientStatisticsService.updateBulkAsync({
time: this.currentTimeSlot, time: this.currentTimeSlot,
clientId: client.id, clientId: client.id,
shares: this.shares, shares: this.shares,
@@ -87,7 +87,7 @@ export class StratumV1ClientStatistics {
// saving to memory for storing later // saving to memory for storing later
this.shares += targetDifficulty; this.shares += targetDifficulty;
this.acceptedCount++; this.acceptedCount++;
this.bulkUpdateIndex = await this.clientStatisticsService.updateBulkAsync({ this.bulkUpdateIndex = this.clientStatisticsService.updateBulkAsync({
time: this.currentTimeSlot, time: this.currentTimeSlot,
clientId: client.id, clientId: client.id,
shares: this.shares, shares: this.shares,