From ac1848c48e830a8d08a9184caf8838c33a2f1735 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Mon, 13 Nov 2023 18:28:17 -0500 Subject: [PATCH] Fixed quit function blocked by lack of db upd8 --- modules/functions.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/functions.js b/modules/functions.js index 716332b..642acc7 100644 --- a/modules/functions.js +++ b/modules/functions.js @@ -275,6 +275,11 @@ const functions = { if (err) console.log('Error removing the quit file: ' + err); config.status.shutdownNextCycle = 1; config.status.auger = 0; + const shutdownNextCycleQuery = "UPDATE status SET value = 1 WHERE key = 'shutdown_next_cycle'"; + dbfn.run(shutdownNextCycleQuery).then(res => { + if (process.env.DEBUG) console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] I: ${res.status}`); + console.log(`[${(Date.now() - config.timestamps.procStart) / 1000}] I: Shutting down next cycle.`); + }).catch(err => console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] E: ${err}`)); resolve(); }); } else {