diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2019-01-13 23:26:05 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2019-01-13 23:26:05 +0000 |
commit | a8c5927c09aaed5aebf941754b057ba3f98b94d3 (patch) | |
tree | 301a150c01473edb79254a0e5fd0f5b8ce277a1f | |
parent | Add missing break mid switch (diff) | |
download | p2pvr-0.3.1.tar.bz2 p2pvr-0.3.1.tar.xz p2pvr-0.3.1.zip |
Don't call service method with a default Ice::Currentp2pvr-0.3.1
-rw-r--r-- | p2pvr/daemon/maintenance.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/p2pvr/daemon/maintenance.cpp b/p2pvr/daemon/maintenance.cpp index 58d9dc2..ea21a13 100644 --- a/p2pvr/daemon/maintenance.cpp +++ b/p2pvr/daemon/maintenance.cpp @@ -71,19 +71,21 @@ MaintenanceI::ScheduledUpdate() AdHoc::ScopeExit notRunning([this]{ updateRunning = false; }); updateRunning = true; time_t now = time(NULL); + auto maint = Ice::checkedCast<MaintenancePrx>(adapter->createProxy(Ice::stringToIdentity("Maintenance"))); + if (lastUpdateNetwork < now - options->periodUpdateNetwork) { logger->messagebf(LogLevel::INFO, "%s: updating network", __PRETTY_FUNCTION__); - this->UpdateNetwork(FE_OFDM, Ice::Current()); + maint->UpdateNetwork(FE_OFDM); time(&lastUpdateNetwork); } if (lastUpdateServices < now - options->periodUpdateServices) { logger->messagebf(LogLevel::INFO, "%s: updating services", __PRETTY_FUNCTION__); - this->UpdateServices(Ice::Current()); + maint->UpdateServices(); time(&lastUpdateServices); } if (lastUpdateEvents < now - options->periodUpdateEvents) { logger->messagebf(LogLevel::INFO, "%s: updating events", __PRETTY_FUNCTION__); - this->UpdateEvents(Ice::Current()); + maint->UpdateEvents(); time(&lastUpdateEvents); } logger->messagebf(LogLevel::DEBUG, "%s: completed", __PRETTY_FUNCTION__); |