From 2c128842476c69c9b1c47c6d1dc53211dd991bd0 Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Fri, 6 Nov 2020 15:46:24 -0400 Subject: [PATCH] handle dupe ping sockets better --- src/sockets.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sockets.js b/src/sockets.js index b18589cc..8e4d05e7 100644 --- a/src/sockets.js +++ b/src/sockets.js @@ -439,7 +439,11 @@ module.exports = ( } if (pingIntervalID !== null) { - logger.error('Tried to set ping socket twice') + logger.error( + 'Tried to set ping socket twice, this might be due to an app restart and the old socket not being recycled by socket.io in time, will disable the older ping interval, which means the old socket wont work and will ping this new socket instead' + ) + clearInterval(pingIntervalID) + pingIntervalID = null } socket.emit('shockping')