From d73336401973b2d11d68e40983589e2ee85b5703 Mon Sep 17 00:00:00 2001 From: Andrii Date: Fri, 3 Jan 2025 19:38:17 +0200 Subject: [PATCH] Fixed hearbeat inteval reset issue --- .../websockets/data_providers/account_statuses_provider.go | 2 +- .../access/rest/websockets/data_providers/events_provider.go | 2 +- engine/access/rest/websockets/legacy/websocket_handler.go | 2 +- engine/access/state_stream/backend/handler.go | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/engine/access/rest/websockets/data_providers/account_statuses_provider.go b/engine/access/rest/websockets/data_providers/account_statuses_provider.go index 396dcbc7b9a..8acb43ce679 100644 --- a/engine/access/rest/websockets/data_providers/account_statuses_provider.go +++ b/engine/access/rest/websockets/data_providers/account_statuses_provider.go @@ -108,8 +108,8 @@ func (p *AccountStatusesDataProvider) handleResponse() func(accountStatusesRespo if blocksSinceLastMessage < p.heartbeatInterval { return nil } - blocksSinceLastMessage = 0 } + blocksSinceLastMessage = 0 index := messageIndex.Value() if ok := messageIndex.Set(messageIndex.Value() + 1); !ok { diff --git a/engine/access/rest/websockets/data_providers/events_provider.go b/engine/access/rest/websockets/data_providers/events_provider.go index 318e8081d2c..0086a2e8f31 100644 --- a/engine/access/rest/websockets/data_providers/events_provider.go +++ b/engine/access/rest/websockets/data_providers/events_provider.go @@ -94,8 +94,8 @@ func (p *EventsDataProvider) handleResponse() func(eventsResponse *backend.Event if blocksSinceLastMessage < p.heartbeatInterval { return nil } - blocksSinceLastMessage = 0 } + blocksSinceLastMessage = 0 index := messageIndex.Value() if ok := messageIndex.Set(messageIndex.Value() + 1); !ok { diff --git a/engine/access/rest/websockets/legacy/websocket_handler.go b/engine/access/rest/websockets/legacy/websocket_handler.go index 06aa8323de4..1b09b958751 100644 --- a/engine/access/rest/websockets/legacy/websocket_handler.go +++ b/engine/access/rest/websockets/legacy/websocket_handler.go @@ -146,8 +146,8 @@ func (wsController *WebsocketController) writeEvents(sub subscription.Subscripti if blocksSinceLastMessage < wsController.HeartbeatInterval { continue } - blocksSinceLastMessage = 0 } + blocksSinceLastMessage = 0 // EventsResponse contains CCF encoded events, and this API returns JSON-CDC events. // convert event payload formats. diff --git a/engine/access/state_stream/backend/handler.go b/engine/access/state_stream/backend/handler.go index 3acf1bad6ca..927ff347af4 100644 --- a/engine/access/state_stream/backend/handler.go +++ b/engine/access/state_stream/backend/handler.go @@ -370,8 +370,8 @@ func (h *Handler) handleEventsResponse(send sendSubscribeEventsResponseFunc, hea if blocksSinceLastMessage < heartbeatInterval { return nil } - blocksSinceLastMessage = 0 } + blocksSinceLastMessage = 0 // BlockExecutionData contains CCF encoded events, and the Access API returns JSON-CDC events. // convert event payload formats. @@ -490,8 +490,8 @@ func (h *Handler) handleAccountStatusesResponse( if blocksSinceLastMessage < heartbeatInterval { return nil } - blocksSinceLastMessage = 0 } + blocksSinceLastMessage = 0 results, err := convertAccountsStatusesResultsToMessage(evenVersion, resp) if err != nil {