Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-cpplib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-cpplib
Commits
1ebb197c
Verified
Commit
1ebb197c
authored
2 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
MAINT: Move call of ProcessTerminated to DoExecute...
parent
c9360a7b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!42
Release 0.2.0
,
!28
F async execute
Pipeline
#24642
passed
2 years ago
Stage: info
Stage: setup
Stage: test
Stage: deploy
Pipeline: caosdb-cppinttest
#24644
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/caosdb/logging.h
+4
-2
4 additions, 2 deletions
include/caosdb/logging.h
src/caosdb/logging.cpp
+0
-1
0 additions, 1 deletion
src/caosdb/logging.cpp
src/caosdb/transaction.cpp
+16
-18
16 additions, 18 deletions
src/caosdb/transaction.cpp
with
20 additions
and
21 deletions
include/caosdb/logging.h
+
4
−
2
View file @
1ebb197c
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
src/caosdb/logging.cpp
+
0
−
1
View file @
1ebb197c
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
src/caosdb/transaction.cpp
+
16
−
18
View file @
1ebb197c
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment