Skip to content

Commit f0fde20

Browse files
Ruben van LeeuwenDutchBen
authored andcommitted
822: Small refactor
1 parent 14109a2 commit f0fde20

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/orchestrator-ui-components/src/rtk/endpoints/streamMessages.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const getWebSocket = async (url: string) => {
2525
};
2626

2727
const PING_INTERVAL_MS = 30000;
28-
const NO_PONG_RECEIVED_INTERVAL_MS = 35000;
28+
const NO_PONG_RECEIVED_TIMEOUT_MS = 35000;
2929
const INITIAL_CONNECTION_CHECK_INTERVAL_MS = 2000;
3030

3131
type WebSocketMessage = {
@@ -42,7 +42,7 @@ enum MessageTypes {
4242
* the connection in between
4343
* - It sends a ping message right after the connection is established. If no pong is received within INITIAL_CONNECTION_CHECK_INTERVAL_MS the connection
4444
* is considered lost
45-
* - It sends a ping message every PING_INTERVAL ms to keep the connection alive. It no pong is received withing NO_PONG_RECEIVED_INTERVAL_MS the connection
45+
* - It sends a ping message every PING_INTERVAL ms to keep the connection alive. It no pong is received withing NO_PONG_RECEIVED_TIMEOUT_MS the connection
4646
* is considered lost
4747
* - It debounces the close event to avoid closing the connection every time a 'pong' message is received
4848
* - It closes the connection if any websocket error or close event is received
@@ -107,7 +107,7 @@ const streamMessagesApi = orchestratorApi.injectEndpoints({
107107
INITIAL_CONNECTION_CHECK_INTERVAL_MS,
108108
);
109109
const debounceClosingConnection = getDebounce(
110-
NO_PONG_RECEIVED_INTERVAL_MS,
110+
NO_PONG_RECEIVED_TIMEOUT_MS,
111111
);
112112

113113
// Starts the websocket

0 commit comments

Comments
 (0)