fix: subscribe to servers

This commit is contained in:
Alexis Tyler
2021-07-22 10:33:03 +09:30
parent e7258b1b64
commit c657eef52c
2 changed files with 3 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ import { varState } from '../core/states/var';
import packageJson from '../../package.json';
import { paths } from '../core/paths';
import { loadState } from '../core/utils/misc/load-state';
import { subscribeToServers } from './subscribe-to-servers';
export const sockets = {
internal: null as GracefulWebSocket | null,
@@ -35,6 +36,7 @@ export const startInternal = (apiKey: string) => {
// Internal is ready at this point
if (!sockets.relay) {
startRelay(apiKey);
subscribeToServers(apiKey);
}
});

View File

@@ -21,7 +21,7 @@ export const mothership = new SubscriptionClient(MOTHERSHIP_GRAPHQL_LINK, {
}
});
export const subscribeToServers = async (apiKey: string) => {
export const subscribeToServers = (apiKey: string) => {
log.silly('Subscribing to servers with %s', apiKey);
const query = mothership.request({
query: `subscription servers ($apiKey: String!) {