Skip to content

Commit 3931717

Browse files
Barthelemyknopers8
authored andcommitted
[QC-1326] Fix boost warning
1 parent cc66b71 commit 3931717

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Framework/src/RepositoryBenchmark.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void RepositoryBenchmark::InitTask()
130130

131131
// start a timer in a thread to send monitoring metrics, if needed
132132
if (mThreadedMonitoring) {
133-
mTimer = new boost::asio::deadline_timer(io, boost::posix_time::seconds(mThreadedMonitoringInterval));
133+
mTimer = new boost::asio::system_timer(io, seconds(mThreadedMonitoringInterval));
134134
mTimer->async_wait(boost::bind(&RepositoryBenchmark::checkTimedOut, this));
135135
th = new thread([&] { io.run(); });
136136
}
@@ -141,7 +141,7 @@ void RepositoryBenchmark::checkTimedOut()
141141
mMonitoring->send({ mTotalNumberObjects, "ccdb_benchmark_objects_sent" }, DerivedMetricMode::RATE);
142142

143143
// restart timer
144-
mTimer->expires_at(mTimer->expires_at() + boost::posix_time::seconds(mThreadedMonitoringInterval));
144+
mTimer->expires_after(seconds(mThreadedMonitoringInterval));
145145
mTimer->async_wait(boost::bind(&RepositoryBenchmark::checkTimedOut, this));
146146
}
147147

Framework/src/RepositoryBenchmark.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <TH1.h>
2323
#include <Monitoring/MonitoringFactory.h>
2424
#include <boost/asio.hpp>
25-
#include <boost/asio/deadline_timer.hpp>
25+
#include <boost/asio/system_timer.hpp>
2626
#include <thread>
2727
#include <string>
2828

@@ -64,7 +64,7 @@ class RepositoryBenchmark : public fair::mq::Device
6464
// TH1* mMyHisto;
6565

6666
// variables for the timer
67-
boost::asio::deadline_timer* mTimer; /// the asynchronous timer to send monitoring data
67+
boost::asio::system_timer* mTimer; /// the asynchronous timer to send monitoring data
6868
boost::asio::io_context io;
6969
std::thread* th;
7070
};

0 commit comments

Comments
 (0)