diff --git a/services/backup/src/Reactors/server/SendLogReactor.cpp b/services/backup/src/Reactors/server/SendLogReactor.cpp --- a/services/backup/src/Reactors/server/SendLogReactor.cpp +++ b/services/backup/src/Reactors/server/SendLogReactor.cpp @@ -132,15 +132,18 @@ void SendLogReactor::terminateCallback() { const std::lock_guard lock(this->reactorStateMutex); - if (this->persistenceMethod == PersistenceMethod::DB || + if (this->persistenceMethod != PersistenceMethod::BLOB || this->putReactor == nullptr) { + this->persistenceMethod = PersistenceMethod::DB; + this->storeInDatabase(); return; } this->putReactor->scheduleSendingDataChunk(std::make_unique("")); std::unique_lock lockPut(this->blobPutDoneCVMutex); if (this->putReactor->getStatusHolder()->state != ReactorState::DONE) { this->blobPutDoneCV.wait(lockPut); - } else if (!this->putReactor->getStatusHolder()->getStatus().ok()) { + } + if (!this->putReactor->getStatusHolder()->getStatus().ok()) { throw std::runtime_error( this->putReactor->getStatusHolder()->getStatus().error_message()); }