mirror of
https://github.com/unraid/api.git
synced 2026-01-07 17:19:52 -06:00
fix: ensure we close old relay if it's open on connect
This commit is contained in:
@@ -106,6 +106,11 @@ class MothershipService {
|
||||
if (!apiKey) {
|
||||
throw new AppError('API key was removed between the file update event and now.');
|
||||
}
|
||||
|
||||
// Kill existing socket before overriding
|
||||
if (this.relay) {
|
||||
this.relay.terminate();
|
||||
}
|
||||
|
||||
// Connect to mothership's relay endpoint
|
||||
this.relay = new WebSocket(this.relayWebsocketLink, ['graphql-ws'], {
|
||||
|
||||
Reference in New Issue
Block a user