diff --git a/index.js b/index.js index f54cd37..0c99ad4 100644 --- a/index.js +++ b/index.js @@ -33,11 +33,9 @@ app.put('/api/connect/:jobid', (req, res) => { } }) ws_[id].open = false; - setInterval(() => { - ws_[id].connection.on('open', () => { - ws_[id].open = true; - }); - }) + ws_[id].connection.on('open', () => { + ws_[id].open = true; + }); ws_[id].connection.on("error", () => { res.status(500); })