From 1ffd6ff7b0c0bd97c9ce59b8c0fa8bd27ebbaf25 Mon Sep 17 00:00:00 2001 From: cv <34649812+cpvalente@users.noreply.github.com> Date: Thu, 28 Oct 2021 14:43:46 +0200 Subject: [PATCH] fix: shutdown restore shutdown --- server/src/app.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/server/src/app.js b/server/src/app.js index 99302d9e7..8b2704252 100644 --- a/server/src/app.js +++ b/server/src/app.js @@ -163,3 +163,21 @@ export const startServer = async (overrideConfig = null) => { return returnMessage; }; + +export const shutdown = async () => { + console.log('Node service shutdown'); + + user.event('NODE', 'shutdown', 'requesting node shutfown').send(); + + // shutdown express server + server.close(); + + // shutdown OSC Server + shutdownOSCServer(); + + // shutdown OSC Client + oscClient.close(); + + // shutdown timer + global.timer.shutdown(); +};