Fixed quit function blocked by lack of db upd8

This commit is contained in:
Skylar Grant 2023-11-13 18:28:17 -05:00
parent 2358d6eb8f
commit ac1848c48e
1 changed files with 5 additions and 0 deletions

View File

@ -275,6 +275,11 @@ const functions = {
if (err) console.log('Error removing the quit file: ' + err); if (err) console.log('Error removing the quit file: ' + err);
config.status.shutdownNextCycle = 1; config.status.shutdownNextCycle = 1;
config.status.auger = 0; 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(); resolve();
}); });
} else { } else {