summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--p2pvr/daemon/maintenance.cpp11
-rw-r--r--p2pvr/daemon/maintenance.h1
2 files changed, 8 insertions, 4 deletions
diff --git a/p2pvr/daemon/maintenance.cpp b/p2pvr/daemon/maintenance.cpp
index 928e8d9..e3747b3 100644
--- a/p2pvr/daemon/maintenance.cpp
+++ b/p2pvr/daemon/maintenance.cpp
@@ -10,6 +10,7 @@
time_t Maintenance::periodUpdateNetwork;
time_t Maintenance::periodUpdateServices;
time_t Maintenance::periodUpdateEvents;
+bool Maintenance::scanOnStart;
DECLARE_OPTIONS(Maintenance, "P2PVR Maintenance options")
("p2pvr.maintenance.periodUpdateNetwork", Options::value(&periodUpdateNetwork, 86400 * 7),
@@ -18,12 +19,14 @@ DECLARE_OPTIONS(Maintenance, "P2PVR Maintenance options")
"Period between automated updates of DVB services (1 week)")
("p2pvr.maintenance.periodUpdateEvents", Options::value(&periodUpdateEvents, 3600 * 12),
"Period between automated updates of DVB events (12 hours)")
+("p2pvr.maintenance.scanOnStart", Options::value(&scanOnStart, false),
+ "Perform the maintenance circle on start-up (false)")
END_OPTIONS(Maintenance);
Maintenance::Maintenance(Ice::ObjectAdapterPtr a, IceUtil::TimerPtr t) :
adapter(a),
timer(t),
- clientCheck(new BindTimerTask(boost::bind(&Maintenance::ScheduledUpdate, this))),
+ clientCheck(new BindTimerTask(boost::bind(&Maintenance::ScheduledUpdate, this))),
lastUpdateNetwork(0),
lastUpdateServices(0),
lastUpdateEvents(0),
@@ -32,9 +35,9 @@ Maintenance::Maintenance(Ice::ObjectAdapterPtr a, IceUtil::TimerPtr t) :
if (timer) {
timer->scheduleRepeated(clientCheck, IceUtil::Time::seconds(5 * 60));
}
-#ifdef NDEBUG
- ScheduledUpdate();
-#endif
+ if (scanOnStart) {
+ ScheduledUpdate();
+ }
}
void
diff --git a/p2pvr/daemon/maintenance.h b/p2pvr/daemon/maintenance.h
index 5b663eb..7ec0541 100644
--- a/p2pvr/daemon/maintenance.h
+++ b/p2pvr/daemon/maintenance.h
@@ -31,6 +31,7 @@ class Maintenance : public P2PVR::Maintenance, public DatabaseClient {
static time_t periodUpdateNetwork;
static time_t periodUpdateServices;
static time_t periodUpdateEvents;
+ static bool scanOnStart;
};
#endif