re-assign active file on file corruption when necessary
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
EIVE/eive-obsw/pipeline/pr-main There was a failure building this commit

This commit is contained in:
Robin Müller 2023-06-18 12:49:22 +02:00
parent 07ca95205d
commit c3679f044c
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

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. // restore the file dump, but for now do not trust the file.
std::error_code e; std::error_code e;
std::filesystem::remove(dumpParams.dirEntry.path().c_str(), e); std::filesystem::remove(dumpParams.dirEntry.path().c_str(), e);
if(dumpParams.dirEntry.path() == activeFile) {
activeFile == std::nullopt;
assignAndOrCreateMostRecentFile();
}
fileHasSwapped = true; fileHasSwapped = true;
return loadNextDumpFile(); return loadNextDumpFile();
} }