From b978b8ae4c335d3193a1644b8a11ceecb377639f Mon Sep 17 00:00:00 2001 From: natsoni Date: Mon, 29 Jun 2026 11:39:44 +0200 Subject: [PATCH 1/2] Send stratum jobs only when requested on stratum page --- backend/src/api/websocket-handler.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/backend/src/api/websocket-handler.ts b/backend/src/api/websocket-handler.ts index cea0ce781..90f85a383 100644 --- a/backend/src/api/websocket-handler.ts +++ b/backend/src/api/websocket-handler.ts @@ -450,7 +450,7 @@ class WebsocketHandler { if (parsedMessage['track-stratum'] === 'all' || typeof parsedMessage['track-stratum'] === 'number') { const sub = parsedMessage['track-stratum']; client['track-stratum'] = sub; - response['stratumJobs'] = this.socketData['stratumJobs']; + response['stratumJobs'] = JSON.stringify(stratumApi.getJobs()); } else { client['track-stratum'] = false; } @@ -1369,8 +1369,6 @@ class WebsocketHandler { } public handleNewStratumJob(job: StratumJob): void { - this.updateSocketDataFields({ 'stratumJobs': stratumApi.getJobs() }); - for (const server of this.webSocketServers) { server.clients.forEach((client) => { if (client.readyState !== WebSocket.OPEN) { From 3b1db74761e5db37d54625816ba139e0c48f693b Mon Sep 17 00:00:00 2001 From: mononaut Date: Tue, 30 Jun 2026 07:54:52 +0000 Subject: [PATCH 2/2] fix stratum websocket un-subscriptions --- backend/src/api/websocket-handler.ts | 2 +- frontend/src/app/components/pool/pool.component.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/src/api/websocket-handler.ts b/backend/src/api/websocket-handler.ts index 90f85a383..17bc72890 100644 --- a/backend/src/api/websocket-handler.ts +++ b/backend/src/api/websocket-handler.ts @@ -446,7 +446,7 @@ class WebsocketHandler { delete client['track-mempool']; } - if (parsedMessage && parsedMessage['track-stratum'] != null) { + if (parsedMessage && parsedMessage['track-stratum'] !== undefined) { if (parsedMessage['track-stratum'] === 'all' || typeof parsedMessage['track-stratum'] === 'number') { const sub = parsedMessage['track-stratum']; client['track-stratum'] = sub; diff --git a/frontend/src/app/components/pool/pool.component.ts b/frontend/src/app/components/pool/pool.component.ts index 1b006549c..427035693 100644 --- a/frontend/src/app/components/pool/pool.component.ts +++ b/frontend/src/app/components/pool/pool.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component, Inject, Input, LOCALE_ID, OnInit } from '@angular/core'; +import { ChangeDetectionStrategy, Component, Inject, Input, LOCALE_ID, OnDestroy, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { echarts, EChartsOption } from '@app/graphs/echarts'; import { BehaviorSubject, Observable, Subscription, combineLatest, of } from 'rxjs'; @@ -26,7 +26,7 @@ interface AccelerationTotal { standalone: false, changeDetection: ChangeDetectionStrategy.OnPush }) -export class PoolComponent implements OnInit { +export class PoolComponent implements OnInit, OnDestroy { @Input() right: number | string = 45; @Input() left: number | string = 75; @@ -365,5 +365,6 @@ export class PoolComponent implements OnInit { ngOnDestroy(): void { this.slugSubscription.unsubscribe(); + this.websocketService.stopTrackStratum(); } }