re-assign active file on file corruption when necessary #688

Merged
muellerr merged 2 commits from reassign-active-file-on-corruption into main 2023-06-20 18:21:32 +02:00
Showing only changes of commit c3679f044c - Show all commits

View File

@ -268,6 +268,10 @@ ReturnValue_t PersistentTmStore::getNextDumpPacket(PusTmReader& reader, bool& fi
// restore the file dump, but for now do not trust the file.
std::error_code e;
std::filesystem::remove(dumpParams.dirEntry.path().c_str(), e);
if(dumpParams.dirEntry.path() == activeFile) {
activeFile == std::nullopt;
assignAndOrCreateMostRecentFile();
}
fileHasSwapped = true;
return loadNextDumpFile();
}