mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
synced 2025-10-29 18:02:29 +00:00
Fix the fix...arg
This commit is contained in:
@@ -349,6 +349,8 @@ namespace OpenWifi {
|
||||
std::lock_guard G(Mutex_);
|
||||
auto It = UserCache_.find(Token);
|
||||
|
||||
std::cout << "Checking token: " << Token << std::endl;
|
||||
|
||||
if(It==UserCache_.end())
|
||||
return false;
|
||||
WebToken = It->second.webtoken;
|
||||
|
||||
@@ -16,12 +16,24 @@ namespace OpenWifi {
|
||||
StorageClass::Start();
|
||||
Create_Tables();
|
||||
InitializeDefaultUser();
|
||||
|
||||
Archivercallback_ = std::make_unique<Poco::TimerCallback<Archiver>>(Archiver_,&Archiver::onTimer);
|
||||
Timer_.setStartInterval( 30 * 1000); // first run in 5 minutes
|
||||
Timer_.setPeriodicInterval(60 * 1000); // 1 hours
|
||||
Timer_.start(*Archivercallback_);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Storage::Stop() {
|
||||
Logger_.notice("Stopping.");
|
||||
Timer_.stop();
|
||||
StorageClass::Stop();
|
||||
}
|
||||
|
||||
void Archiver::onTimer(Poco::Timer &timer) {
|
||||
std::cout << "Timer fired..." << std::endl;
|
||||
}
|
||||
|
||||
}
|
||||
// namespace
|
||||
@@ -13,6 +13,8 @@
|
||||
#include "framework/StorageClass.h"
|
||||
#include "AuthService.h"
|
||||
|
||||
#include "Poco/Timer.h"
|
||||
|
||||
namespace OpenWifi {
|
||||
|
||||
static const std::string AllEmailTemplatesFieldsForCreation {
|
||||
@@ -27,6 +29,12 @@ namespace OpenWifi {
|
||||
|
||||
};
|
||||
|
||||
class Archiver {
|
||||
public:
|
||||
void onTimer(Poco::Timer & timer);
|
||||
private:
|
||||
};
|
||||
|
||||
class Storage : public StorageClass {
|
||||
public:
|
||||
|
||||
@@ -129,6 +137,10 @@ namespace OpenWifi {
|
||||
int Create_TokensTable();
|
||||
int Create_ActionLinkTable();
|
||||
|
||||
Poco::Timer Timer_;
|
||||
Archiver Archiver_;
|
||||
std::unique_ptr<Poco::TimerCallback<Archiver>> Archivercallback_;
|
||||
|
||||
/// This is to support a mistake that was deployed...
|
||||
void ReplaceOldDefaultUUID();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user