Skip to content

Commit dec5587

Browse files
committed
[QC-1322] Call the BK registration within a thread.
1 parent 18b34be commit dec5587

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

Framework/src/Bookkeeping.cxx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <unistd.h>
2323
#include <filesystem>
2424
#include <fstream>
25+
#include <thread>
2526

2627
using namespace o2::bkp::api;
2728

@@ -113,7 +114,14 @@ void Bookkeeping::registerProcess(int runNumber, const std::string& name, const
113114
if (!mInitialized) {
114115
return;
115116
}
116-
mClient->dplProcessExecution()->registerProcessExecution(runNumber, type, getHostName(), name, args, detector);
117+
118+
std::thread([this, runNumber, type, name, args, detector]() {
119+
try{
120+
this->mClient->dplProcessExecution()->registerProcessExecution(runNumber, type, getHostName(), name, args, detector);
121+
} catch (std::runtime_error& error) { // catch here because we are in a thread
122+
ILOG(Warning, Devel) << "Failed registration to the BookKeeping: " << error.what() << ENDM;
123+
}
124+
}).detach();
117125
}
118126

119127
std::vector<int> Bookkeeping::sendFlagsForSynchronous(uint32_t runNumber, const std::string& detectorName, const std::vector<QcFlag>& qcFlags)

0 commit comments

Comments
 (0)