diff --git a/build b/build index 4e9e288..b44fe09 100644 --- a/build +++ b/build @@ -1 +1 @@ -63 \ No newline at end of file +65 \ No newline at end of file diff --git a/owfms.properties b/owfms.properties index 447d143..625561d 100644 --- a/owfms.properties +++ b/owfms.properties @@ -48,6 +48,7 @@ s3.key = ******************************************* s3.retry = 60 s3.bucket.uri = ucentral-ap-firmware.s3.amazonaws.com +autoupdater.enabled = true ############################# # Generic information for all micro services diff --git a/src/AutoUpdater.cpp b/src/AutoUpdater.cpp index 4e1ac43..3f54d52 100644 --- a/src/AutoUpdater.cpp +++ b/src/AutoUpdater.cpp @@ -15,18 +15,23 @@ namespace OpenWifi { int AutoUpdater::Start() { Running_ = true; AutoUpdaterFrequency_ = Daemon()->ConfigGetInt("autoupdater.frequency",600); - AutoUpdaterEnabled_ = Daemon()->ConfigGetBool("autoupdater.enabled", true); - Thr_.start(*this); + AutoUpdaterEnabled_ = Daemon()->ConfigGetBool("autoupdater.enabled", false); + if(AutoUpdaterEnabled_) + Thr_.start(*this); return 0; } void AutoUpdater::Stop() { Running_ = false; - Thr_.wakeUp(); - Thr_.join(); + if(AutoUpdaterEnabled_) { + Thr_.wakeUp(); + Thr_.join(); + } } void AutoUpdater::ToBeUpgraded(std::string serialNumber, std::string DeviceType) { + if(!AutoUpdaterEnabled_) + return; std::lock_guard G(Mutex_); Queue_.emplace_back(std::make_pair(std::move(serialNumber),std::move(DeviceType))); }