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