fix: when relay drops reconnect internally

This commit is contained in:
Alexis Tyler
2021-03-20 01:09:53 +10:30
parent a5217b6e82
commit 97edc3ae1f
+5
View File
@@ -7,6 +7,7 @@ import { AppError } from '../../core/errors';
import { readFileIfExists } from '../utils';
import { CustomSocket, WebSocketWithHeartBeat } from '../custom-socket';
import packageJson from '../../../package.json';
import { sockets } from '../../sockets';
export class MothershipSocket extends CustomSocket {
private mothershipServersEndpoint?: {
@@ -49,6 +50,10 @@ export class MothershipSocket extends CustomSocket {
// Close connection to motherships's server's endpoint
await this.disconnectFromMothershipsGraphql();
// Close connection to internal graphql
const internalGraphqlClient = sockets.get('internalGraphql');
await internalGraphqlClient?.disconnect();
// Process disconnection
await onDisconnect(code, message);
} catch (error: unknown) {