Initial commit

This commit is contained in:
stephb9959
2022-01-10 10:31:20 -08:00
parent d4cf9a401b
commit 9f0059d4e4
43 changed files with 12086 additions and 0 deletions

44
src/StorageService.cpp Normal file
View File

@@ -0,0 +1,44 @@
//
// License type: BSD 3-Clause License
// License copy: https://github.com/Telecominfraproject/wlan-cloud-ucentralgw/blob/master/LICENSE
//
// Created by Stephane Bourque on 2021-03-04.
// Arilia Wireless Inc.
//
#include "StorageService.h"
#include "RESTObjects/RESTAPI_ProvObjects.h"
namespace OpenWifi {
int Storage::Start() {
std::lock_guard Guard(Mutex_);
StorageClass::Start();
Updater_.start(*this);
return 0;
}
void Storage::run() {
Running_ = true ;
bool FirstRun=true;
long Retry = 2000;
while(Running_) {
if(!FirstRun)
Poco::Thread::trySleep(Retry);
if(!Running_)
break;
FirstRun = false;
Retry = 2000;
}
}
void Storage::Stop() {
Running_=false;
Updater_.wakeUp();
Updater_.join();
Logger().notice("Stopping.");
}
}
// namespace