From 6232258ce6d86599df9fba99d317164d61af5a89 Mon Sep 17 00:00:00 2001 From: MeowcaTheoRange Date: Thu, 22 Feb 2024 06:07:56 -0600 Subject: [PATCH] Don't depend on notification server to run. stinky --- index.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index e36c7cf..32513fa 100644 --- a/index.js +++ b/index.js @@ -284,17 +284,18 @@ const socket = io.connect(`http://${process.env.NOTIFICATION_SERVER_INSTANCE}:${ socket.on('connect', function (s) { console.log('Successfully connected to notification server'); - try { - main(); - } catch (err) { - socket.emit('nodeMessage', { - message: `LastFMDownloader error - ${err}`, - password: process.env.NOTIFICATION_SERVER_PASSWORD - }) - throw err; - } }); +try { + main(); +} catch (err) { + socket.emit('nodeMessage', { + message: `LastFMDownloader error - ${err}`, + password: process.env.NOTIFICATION_SERVER_PASSWORD + }) + throw err; +} + function dismantle() { socket.disconnect(); return null;