Fixed startup failure bug
This commit is contained in:
parent
9e6e813b4c
commit
0b6794fb89
6
main.js
6
main.js
@ -9,9 +9,15 @@ portal.start();
|
||||
|
||||
dbfn.run(`UPDATE timestamps SET value = ${Date.now()} WHERE key = 'process_start'`).catch(err => console.error(`Error setting process start time: ${err}`));
|
||||
|
||||
// Initialization, which then calls main()
|
||||
fn.commands.refreshConfig().then(res => {
|
||||
if (process.env.DEBUG) console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] I: ${res.status}`);
|
||||
config = res.config;
|
||||
const shutdownNextCycleQuery = "UPDATE status SET value = 0 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: Shutdown flag reset.`);
|
||||
}).catch(err => console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] E: ${err}`));
|
||||
// Setup for use with the Pi's GPIO pins
|
||||
switch (process.env.ONPI) {
|
||||
case 'true':
|
||||
|
Loading…
Reference in New Issue
Block a user