Refactor TM handling #450

Merged
muellerr merged 47 commits from refactor_tm_handling into develop 2023-03-11 15:05:22 +01:00
2 changed files with 4 additions and 1 deletions
Showing only changes of commit 127a8e6124 - Show all commits

View File

@ -179,6 +179,9 @@ ReturnValue_t PersistentTmStore::startDumpFromUpTo(uint32_t fromUnixSeconds,
return returnvalue::FAILED;
}
dumpParams.dirIter = directory_iterator(basePath);
if(dumpParams.dirIter == directory_iterator()) {
return returnvalue::FAILED;
}
dumpParams.fromUnixTime = fromUnixSeconds;
dumpParams.untilUnixTime = upToUnixSeconds;
state = State::DUMPING;
@ -193,6 +196,7 @@ 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)) {

View File

@ -24,7 +24,6 @@ bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store, Countd
if (not channel.isBusy()) {
// TODO: Maybe do a bit of a delay every 100-200 packets?
// TODO: We could continously dump until a file swap during active downlink..
// TODO: handle returnvalue?
result = store.dumpNextPacket(channel, dumpedLen, fileHasSwapped);
if (result == returnvalue::OK) {
dumpsPerformed = true;