Skip to content
Snippets Groups Projects
Verified Commit 1ebb197c authored by Timm Fitschen's avatar Timm Fitschen
Browse files

MAINT: Move call of ProcessTerminated to DoExecute...

parent c9360a7b
No related branches found
No related tags found
2 merge requests!42Release 0.2.0,!28F async execute
Pipeline #24642 passed
Pipeline: caosdb-cppinttest

#24644

    ......@@ -64,10 +64,12 @@ class TraceEnterLeaveLogger {
    public:
    inline TraceEnterLeaveLogger(const std::string &channel, const std::string &function_name)
    : channel(channel), function_name(function_name) {
    caosdb::logging::LoggerOutputStream::get(this->channel, CAOSDB_LOG_LEVEL_TRACE) << "Enter " << this->function_name;
    caosdb::logging::LoggerOutputStream::get(this->channel, CAOSDB_LOG_LEVEL_TRACE)
    << "Enter " << this->function_name;
    }
    inline ~TraceEnterLeaveLogger() {
    caosdb::logging::LoggerOutputStream::get(this->channel, CAOSDB_LOG_LEVEL_TRACE) << "Leave " << this->function_name;
    caosdb::logging::LoggerOutputStream::get(this->channel, CAOSDB_LOG_LEVEL_TRACE)
    << "Leave " << this->function_name;
    }
    private:
    ......
    ......@@ -40,7 +40,6 @@
    #include <boost/smart_ptr/shared_ptr.hpp>
    #include <cstdint> // for uint64_t
    #include <memory>
    #include <ostream> // for ostream
    #include <sstream>
    #include <string>
    #include <utility> // for move
    ......
    ......@@ -31,19 +31,17 @@
    #include <algorithm> // for max
    // IWYU pragma: no_include <bits/exception.h>
    // IWYU pragma: no_include <cxxabi.h>
    #include <exception> // IWYU pragma: keep
    #include <filesystem> // for operator<<, path
    #include <future> // for async, future
    #include <google/protobuf/arena.h> // for Arena
    #include <google/protobuf/generated_message_util.h> // for CreateMessage...
    #include <grpc/impl/codegen/gpr_types.h> // for gpr_timespec
    #include <grpcpp/impl/codegen/completion_queue.h> // for CompletionQueue
    #include <iosfwd> // for streamsize
    #include <map> // for map, operator!=
    #include <memory> // for unique_ptr
    #include <random> // for mt19937, rand...
    #include <system_error> // for std::system_error
    #include <utility> // for move, pair
    #include <exception> // IWYU pragma: keep
    #include <filesystem> // for operator<<, path
    #include <future> // for async, future
    #include <google/protobuf/arena.h> // for Arena
    #include <grpc/impl/codegen/gpr_types.h> // for gpr_timespec
    #include <grpcpp/impl/codegen/completion_queue.h> // for CompletionQueue
    #include <map> // for map, operator!=
    #include <memory> // for unique_ptr
    #include <random> // for mt19937, rand...
    #include <system_error> // for std::system_error
    #include <utility> // for move, pair
    namespace caosdb::transaction {
    using caosdb::entity::v1::EntityTransactionService;
    ......@@ -291,6 +289,9 @@ auto Transaction::DoExecuteTransaction() noexcept -> StatusCode {
    }
    }
    }
    if (this->status.GetCode() == StatusCode::EXECUTING) {
    return ProcessTerminated().GetCode();
    }
    return this->status.GetCode();
    }
    ......@@ -353,6 +354,7 @@ auto Transaction::ProcessRetrieveResponse(RetrieveResponse *retrieve_response,
    }
    auto Transaction::ProcessTerminated() const noexcept -> TransactionStatus {
    CAOSDB_LOG_TRACE_ENTER_AND_LEAVE(logger_name, "Transaction::ProcessTerminated()")
    bool set_error = false;
    auto *responses = this->response->mutable_responses();
    std::vector<std::unique_ptr<Entity>> entities;
    ......@@ -418,11 +420,7 @@ auto Transaction::WaitForIt() const noexcept -> TransactionStatus {
    this->transaction_future.wait();
    if (this->status.GetCode() != StatusCode::EXECUTING) {
    return this->status;
    }
    return ProcessTerminated();
    return this->status;
    }
    // NOLINTNEXTLINE
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment