From c6becf920ff980b34a90aa653ef2da591472ff11 Mon Sep 17 00:00:00 2001 From: Alexis Tyler Date: Tue, 1 Jun 2021 18:14:40 +0930 Subject: [PATCH] chore: add logs on disconnect/reconnect of sockets --- app/core/watchers/myservers.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/core/watchers/myservers.ts b/app/core/watchers/myservers.ts index e48f5ebe6..b87394be7 100644 --- a/app/core/watchers/myservers.ts +++ b/app/core/watchers/myservers.ts @@ -54,18 +54,22 @@ export const myservers = () => { if (apiManager.getValidKeys().filter(key => key.name === 'my_servers').length === 0) { // Disconnect forcefully from mothership's subscription endpoint so we ensure it doesn't reconnect automatically mothership.close(true, true); + coreLogger.debug('Disconnected mothership\'s subscription endpoint.'); // Disconnect from relay await sockets.get('relay')?.disconnect(4401); + coreLogger.debug('Disconnected mothership\'s relay.'); } // If we have a my_servers key reconnect to mothership if (apiManager.getValidKeys().filter(key => key.name === 'my_servers').length === 1) { // Reconnect to mothership's subscription endpoint mothership.connect(); + coreLogger.debug('Reconnecting mothership\'s subscription endpoint.'); // Reconnect to relay await sockets.get('relay')?.connect(); + coreLogger.debug('Reconnecting mothership\'s relay.'); // Reregister all subscriptions // @ts-expect-error