Permalink
Browse files

Stop when sd card runs out of space

  • Loading branch information...
timdows committed Mar 1, 2017
1 parent 3b26d14 commit 31cb2418a2043d7f5fb7147ffbd2c3ff52c5526b
Showing with 6 additions and 0 deletions.
  1. +6 −0 server.js
@@ -206,6 +206,12 @@ function updateStatus(partial) {
status.freeDiskSpace.value += ' - Capture: ' + formatBytes(captureInfo.available) + ' (' + captureFreePercent + ' %)';
}
status.freeDiskSpace.type = minFreePercent < 10 ? (minFreePercent < 3 ? 'danger' : 'warning') : 'success';

// Check if we should stop the cron due to insufficient diskspace
if (minFreePercent < 5) {
console.log("Stopping due to insufficient free diskspace");
apiActions.stopCapture(null, function(){});
}
});
});
});

0 comments on commit 31cb241

Please sign in to comment.