Skip to content

Commit

Permalink
Improved reboot watchdog functionality
Browse files Browse the repository at this point in the history
User no longer has to modify the rebootWatchdog.json file.
  • Loading branch information
TomKimsey committed Apr 25, 2024
1 parent 7c4bf21 commit b32300d
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,14 @@ private static void initRebootWatchdogFile() throws IOException, JSONException {
ConfigFileAccessManager.getJsonObjectFromFile(REBOOT_WATCHDOG_FILE_PATH);
rebootCount = rebootWatchdogObject.getInt(REBOOT_COUNT_KEY);
rebootCount += 1;
rebootWatchdogObject.put(REBOOT_COUNT_KEY, rebootCount);
}

// Device reboot loop has been detected
if (rebootCount > MAX_REBOOT_COUNT) {
disableJvmRunFile();
// Device reboot loop has been detected
if (rebootCount > MAX_REBOOT_COUNT) {
disableJvmRunFile();
rebootCount = 0;
}

rebootWatchdogObject.put(REBOOT_COUNT_KEY, rebootCount);
}

ConfigFileAccessManager.writeJsonObjectToFile(
Expand Down

0 comments on commit b32300d

Please sign in to comment.