remove double decrement counters
This commit is contained in:
@@ -155,8 +155,6 @@ async function main() {
|
|||||||
|
|
||||||
// Handle disconnection
|
// Handle disconnection
|
||||||
ws.on('close', () => {
|
ws.on('close', () => {
|
||||||
wsConnectionsGauge.dec();
|
|
||||||
|
|
||||||
// Clear any existing intervals and timeouts
|
// Clear any existing intervals and timeouts
|
||||||
clearInterval(pingIntervalId);
|
clearInterval(pingIntervalId);
|
||||||
clearTimeout(pongTimeoutId);
|
clearTimeout(pongTimeoutId);
|
||||||
@@ -167,16 +165,11 @@ async function main() {
|
|||||||
subscribedChannels.delete(channel);
|
subscribedChannels.delete(channel);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
ws.on('disconnect', () => {
|
|
||||||
console.log('Client disconnected');
|
|
||||||
wsConnectionsGauge.dec();
|
wsConnectionsGauge.dec();
|
||||||
});
|
});
|
||||||
|
|
||||||
ws.on('error', (error) => {
|
ws.on('error', (error) => {
|
||||||
console.error('Socket error:', error);
|
console.error('Socket error:', error);
|
||||||
wsConnectionsGauge.dec();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user