Remove debug logs from WebSocket ping/pong handlers
Signed-off-by: YoungSoo Shin <shinys000114@gmail.com>
This commit is contained in:
@@ -28,7 +28,6 @@ function startHeartbeat() {
|
|||||||
pingIntervalId = setInterval(() => {
|
pingIntervalId = setInterval(() => {
|
||||||
if (websocket && websocket.readyState === WebSocket.OPEN) {
|
if (websocket && websocket.readyState === WebSocket.OPEN) {
|
||||||
websocket.send('ping');
|
websocket.send('ping');
|
||||||
console.log('WebSocket: Ping sent.');
|
|
||||||
|
|
||||||
// Set a timeout to check if a pong is received within HEARTBEAT_TIMEOUT
|
// Set a timeout to check if a pong is received within HEARTBEAT_TIMEOUT
|
||||||
pongTimeoutId = setTimeout(() => {
|
pongTimeoutId = setTimeout(() => {
|
||||||
@@ -94,7 +93,6 @@ export function initWebSocket({onOpen, onClose, onMessage, onError}) {
|
|||||||
|
|
||||||
websocket.onmessage = (event) => {
|
websocket.onmessage = (event) => {
|
||||||
if (event.data === 'pong') {
|
if (event.data === 'pong') {
|
||||||
console.log('WebSocket: Pong received.');
|
|
||||||
// Clear the timeout as pong was received, resetting for the next ping
|
// Clear the timeout as pong was received, resetting for the next ping
|
||||||
clearTimeout(pongTimeoutId);
|
clearTimeout(pongTimeoutId);
|
||||||
pongTimeoutId = null;
|
pongTimeoutId = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user