heartbeat updates

This commit is contained in:
Benjamin Wilson
2025-02-26 17:48:27 -05:00
parent 8584c442dc
commit c5c8810da6
3 changed files with 63 additions and 10 deletions
+4 -4
View File
@@ -545,10 +545,10 @@ export class StratumV1Client {
await this.statistics.addShares(this.clientEntity, this.sessionDifficulty);
const now = new Date();
// only update every minute
if (this.clientEntity.updatedAt == null || now.getTime() - this.clientEntity.updatedAt.getTime() > 1000 * 60) {
await this.clientService.heartbeat(this.clientEntity.id, this.hashRate, now);
this.clientEntity.updatedAt = now;
}
//if (this.clientEntity.updatedAt == null || now.getTime() - this.clientEntity.updatedAt.getTime() > 1000 * 60) {
await this.clientService.heartbeatBulkAsync(this.clientEntity.id, this.hashRate, now);
this.clientEntity.updatedAt = now;
//}
} catch (e) {
console.log(e);