mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralfms.git
synced 2026-01-27 10:23:12 +00:00
Adding support for disabling autoupdating.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user