Fix the fix...arg

This commit is contained in:
stephb9959
2021-11-13 08:18:13 -08:00
parent 1a0b549731
commit 3cf23af068
3 changed files with 26 additions and 0 deletions

View File

@@ -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;

View File

@@ -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

View File

@@ -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();
};