mirror of
https://github.com/unraid/api.git
synced 2026-01-09 10:10:45 -06:00
fix: subscribe to servers
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -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!) {
|
||||
|
||||
Reference in New Issue
Block a user