mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
typeo
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user