Move reboot

This commit is contained in:
Ben Meadors 2025-02-27 06:41:09 -06:00
parent 51dc2da83c
commit 96663218ee
2 changed files with 5 additions and 4 deletions

View File

@ -1675,11 +1675,10 @@ bool NodeDB::restorePreferences(meshtastic_AdminMessage_BackupLocation location,
} }
success = saveToDisk(restoreWhat); success = saveToDisk(restoreWhat);
if (!success) { if (success) {
LOG_ERROR("Failed to save restored preferences to flash"); LOG_INFO("Restored preferences from backup");
} else { } else {
LOG_INFO("Restored preferences from backup... Rebooting"); LOG_ERROR("Failed to save restored preferences to flash");
rebootAtMsec = millis() + 1000;
} }
} else { } else {
LOG_ERROR("Failed to restore preferences from backup file"); LOG_ERROR("Failed to restore preferences from backup file");

View File

@ -387,7 +387,9 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
if (nodeDB->restorePreferences(r->backup_preferences, if (nodeDB->restorePreferences(r->backup_preferences,
SEGMENT_DEVICESTATE | SEGMENT_CONFIG | SEGMENT_MODULECONFIG | SEGMENT_CHANNELS)) { SEGMENT_DEVICESTATE | SEGMENT_CONFIG | SEGMENT_MODULECONFIG | SEGMENT_CHANNELS)) {
myReply = allocErrorResponse(meshtastic_Routing_Error_NONE, &mp); myReply = allocErrorResponse(meshtastic_Routing_Error_NONE, &mp);
LOG_DEBUG("Rebooting after successful restore of preferences");
disableBluetooth(); disableBluetooth();
reboot(1000);
} else { } else {
myReply = allocErrorResponse(meshtastic_Routing_Error_BAD_REQUEST, &mp); myReply = allocErrorResponse(meshtastic_Routing_Error_BAD_REQUEST, &mp);
} }