summaryrefslogtreecommitdiff
path: root/p2pvr/daemon/maintenance.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2018-04-29 19:41:12 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2018-04-29 19:41:12 +0100
commit7cce01c40746c3e9925c1ecb4474b025bf2f9c1c (patch)
tree01de3cb198f5df22a2aef1971a3dc306e29fa3a5 /p2pvr/daemon/maintenance.cpp
parentRelease events update transaction before beginning reschedule (diff)
downloadp2pvr-7cce01c40746c3e9925c1ecb4474b025bf2f9c1c.tar.bz2
p2pvr-7cce01c40746c3e9925c1ecb4474b025bf2f9c1c.tar.xz
p2pvr-7cce01c40746c3e9925c1ecb4474b025bf2f9c1c.zip
C++17 and Ice 3.7p2pvr-0.3.0
Updates all components to be C++17 and Ice 3.7
Diffstat (limited to 'p2pvr/daemon/maintenance.cpp')
-rw-r--r--p2pvr/daemon/maintenance.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/p2pvr/daemon/maintenance.cpp b/p2pvr/daemon/maintenance.cpp
index 6abad00..58d9dc2 100644
--- a/p2pvr/daemon/maintenance.cpp
+++ b/p2pvr/daemon/maintenance.cpp
@@ -6,8 +6,10 @@
#include <linux/dvb/frontend.h>
#include <cxxabi.h>
#include <scopeExit.h>
+#include <boost/bind.hpp>
namespace po = boost::program_options;
+using namespace IceTray::Logging;
namespace P2PVR {
MaintenanceI::Options::Options() : IceTray::Options("P2PVR Maintenance options") { }
@@ -24,11 +26,11 @@ ICETRAY_OPTIONS(MaintenanceI::Options,
IceTray::Logging::LoggerPtr MaintenanceI::logger(LOGMANAGER()->getLogger<MaintenanceI>());
-MaintenanceI::MaintenanceI(IceTray::DatabasePoolPtr db, Ice::ObjectAdapterPtr a, IceUtil::TimerPtr t) :
+MaintenanceI::MaintenanceI(DB::ConnectionPoolPtr db, Ice::ObjectAdapterPtr a, IceUtil::TimerPtr t) :
IceTray::AbstractDatabaseClient(db),
adapter(a),
timer(t),
- clientCheck(new BindTimerTask(boost::bind(&MaintenanceI::ScheduledUpdate, this))),
+ clientCheck(std::make_shared<BindTimerTask>(boost::bind(&MaintenanceI::ScheduledUpdate, this))),
lastUpdateNetwork(0),
lastUpdateServices(0),
lastUpdateEvents(0),
@@ -62,7 +64,7 @@ MaintenanceI::UpdateAll(short type, const Ice::Current & ice)
void
MaintenanceI::ScheduledUpdate()
{
- logger->messagebf(LOG::DEBUG, "%s: triggered", __PRETTY_FUNCTION__);
+ logger->messagebf(LogLevel::DEBUG, "%s: triggered", __PRETTY_FUNCTION__);
if (!updateRunning) {
std::thread update([this] {
try {
@@ -70,29 +72,29 @@ MaintenanceI::ScheduledUpdate()
updateRunning = true;
time_t now = time(NULL);
if (lastUpdateNetwork < now - options->periodUpdateNetwork) {
- logger->messagebf(LOG::INFO, "%s: updating network", __PRETTY_FUNCTION__);
+ logger->messagebf(LogLevel::INFO, "%s: updating network", __PRETTY_FUNCTION__);
this->UpdateNetwork(FE_OFDM, Ice::Current());
time(&lastUpdateNetwork);
}
if (lastUpdateServices < now - options->periodUpdateServices) {
- logger->messagebf(LOG::INFO, "%s: updating services", __PRETTY_FUNCTION__);
+ logger->messagebf(LogLevel::INFO, "%s: updating services", __PRETTY_FUNCTION__);
this->UpdateServices(Ice::Current());
time(&lastUpdateServices);
}
if (lastUpdateEvents < now - options->periodUpdateEvents) {
- logger->messagebf(LOG::INFO, "%s: updating events", __PRETTY_FUNCTION__);
+ logger->messagebf(LogLevel::INFO, "%s: updating events", __PRETTY_FUNCTION__);
this->UpdateEvents(Ice::Current());
time(&lastUpdateEvents);
}
- logger->messagebf(LOG::DEBUG, "%s: completed", __PRETTY_FUNCTION__);
+ logger->messagebf(LogLevel::DEBUG, "%s: completed", __PRETTY_FUNCTION__);
}
catch (const std::exception & ex) {
char * buf = __cxxabiv1::__cxa_demangle(typeid(ex).name(), NULL, NULL, NULL);
- logger->messagebf(LOG::ERR, "%s: failed %s: %s", __PRETTY_FUNCTION__, buf, ex.what());
+ logger->messagebf(LogLevel::ERR, "%s: failed %s: %s", __PRETTY_FUNCTION__, buf, ex.what());
free(buf);
}
catch (...) {
- logger->messagebf(LOG::ERR, "%s: failed (unknown exception)", __PRETTY_FUNCTION__);
+ logger->messagebf(LogLevel::ERR, "%s: failed (unknown exception)", __PRETTY_FUNCTION__);
}
});
update.detach();