Skip to content

Commit

Permalink
schedule resume fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
elijahparker committed Jun 29, 2021
1 parent 24e1539 commit aa3517e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion intervalometer/intervalometer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,8 @@ function scheduled(noResume) {
if(intervalometer.status.minutesUntilStart < 0 && intervalometer.status.frames > 0) {
intervalometer.status.message = "done for today, rebooting...";
logEvent("schedule complete, rebooting system and resuming...");
intervalometer.cancel('scheduled', function(){ // each day a new clip is generated
intervalometer.status.autoRestart = true;
return intervalometer.cancel('scheduled', function(){ // each day a new clip is generated
setTimeout(function() {
exec('nohup /bin/sh -c "killall node; sleep 2; killall -s 9 node; init 6"', function() {}); // restarting system
}, 3000);
Expand Down
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5997,7 +5997,7 @@ core.on('intervalometer.status', function(msg) {
mcu.disableGpsTimeUpdate = false;
}
if(msg) {
if(!msg.running && !cache.intervalometerStatus.running && core.currentProgram.autoRestart) {
if(!msg.running && !cache.intervalometerStatus.running && core.currentProgram.autoRestart && !msg.autoRestart) {
console.log("MAIN: Disabling auto restart.");
core.currentProgram.autoRestart = false;
db.set('intervalometer.currentProgram', core.currentProgram);
Expand Down

0 comments on commit aa3517e

Please sign in to comment.