share updates

This commit is contained in:
Ben Wilson 2024-02-17 18:40:34 -05:00
parent 9617ec5685
commit 9895e80a01

View File

@ -44,12 +44,18 @@ export class StratumV1ClientStatistics {
if (this.currentTimeSlot == null) {
this.currentTimeSlot = timeSlot;
}
if (this.currentTimeSlot != timeSlot) {
await this.clientStatisticsService.insert({
time: this.currentTimeSlot,
clientId: client.id,
shares: this.shares,
acceptedCount: this.acceptedCount,
address: client.address,
clientName: client.clientName,
sessionId: client.sessionId
});
this.lastSave = new Date().getTime();
} else if (this.currentTimeSlot != timeSlot) {
await this.clientStatisticsService.insert({
time: this.currentTimeSlot,
shares: this.shares,
acceptedCount: this.acceptedCount,
address: client.address,
@ -62,7 +68,6 @@ export class StratumV1ClientStatistics {
} else if ((date.getTime() - 60 * 1000) > this.lastSave) {
await this.clientStatisticsService.update({
time: this.currentTimeSlot,
clientId: client.id,
shares: this.shares,
acceptedCount: this.acceptedCount,
address: client.address,