bugfixes for iterator handling
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
This commit is contained in:
parent
939d7fd98e
commit
5ea2767662
@ -65,7 +65,7 @@ ReturnValue_t PersistentTmStore::handleCommandQueue(StorageManagerIF& ipcStore)
|
||||
SerializeAdapter::deSerialize(&dumpUntilUnixSeconds, accessor.second.data() + 4, &size,
|
||||
SerializeIF::Endianness::NETWORK);
|
||||
result = startDumpFromUpTo(dumpFromUnixSeconds, dumpUntilUnixSeconds);
|
||||
if (result != returnvalue::OK and result == BUSY_DUMPING) {
|
||||
if (result == BUSY_DUMPING) {
|
||||
triggerEvent(persTmStore::BUSY_DUMPING_EVENT);
|
||||
}
|
||||
}
|
||||
@ -197,14 +197,11 @@ ReturnValue_t PersistentTmStore::loadNextDumpFile() {
|
||||
using namespace std::filesystem;
|
||||
dumpParams.currentSize = 0;
|
||||
std::error_code e;
|
||||
dumpParams.dirIter++;
|
||||
for (; dumpParams.dirIter != directory_iterator(); dumpParams.dirIter++) {
|
||||
dumpParams.dirEntry = *dumpParams.dirIter;
|
||||
if (dumpParams.dirEntry.is_directory(e)) {
|
||||
continue;
|
||||
}
|
||||
sif::debug << "handling file " << dumpParams.dirEntry << std::endl;
|
||||
|
||||
dumpParams.fileSize = std::filesystem::file_size(dumpParams.dirEntry.path(), e);
|
||||
if (e) {
|
||||
sif::error << "PersistentTmStore: Could not retrieve file size: " << e.message() << std::endl;
|
||||
@ -237,6 +234,8 @@ ReturnValue_t PersistentTmStore::loadNextDumpFile() {
|
||||
}
|
||||
ifile.read(reinterpret_cast<char*>(fileBuf.data()),
|
||||
static_cast<std::streamsize>(dumpParams.fileSize));
|
||||
// Increment iterator for next cycle.
|
||||
dumpParams.dirIter++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -252,7 +251,6 @@ ReturnValue_t PersistentTmStore::dumpNextPacket(DirectTmSinkIF& tmSink, size_t&
|
||||
if (state == State::IDLE) {
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
sif::debug << "Current file idx: " << dumpParams.currentSize << std::endl;
|
||||
PusTmReader reader(&timeReader, fileBuf.data() + dumpParams.currentSize,
|
||||
fileBuf.size() - dumpParams.currentSize);
|
||||
// CRC check to fully ensure this is a valid TM
|
||||
|
Loading…
Reference in New Issue
Block a user