From 3e2f59ab08a995bdbc551142b05e4ce2efdba42b Mon Sep 17 00:00:00 2001 From: MisterP Date: Thu, 7 Sep 2023 14:06:10 +0200 Subject: [PATCH] Try to reconnect websocket on close --- Sources/common/common.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/common/common.js b/Sources/common/common.js index a8b986a..4492766 100644 --- a/Sources/common/common.js +++ b/Sources/common/common.js @@ -988,6 +988,7 @@ const StreamDeck = (function () { var events = ELGEvents.eventEmitter(); function connect (args) { + var self = this; inPort = args[0]; inUUID = args[1]; inMessageType = args[2]; @@ -1047,6 +1048,8 @@ const StreamDeck = (function () { // Websocket is closed var reason = WEBSOCKETERROR(evt); console.warn('[STREAMDECK]***** WEBOCKET CLOSED **** reason:', reason); + // retry after delay + setTimeout(self.connect(args), 5000); }; websocket.onmessage = function (evt) {