mirror of
https://github.com/Telecominfraproject/wlan-cloud-owls.git
synced 2026-01-27 02:22:44 +00:00
Merge branch 'WIFI-12378' of https://github.com/telecominfraproject/wlan-cloud-owls into main
This commit is contained in:
@@ -50,19 +50,23 @@ namespace OpenWifi {
|
||||
void SimulationCoordinator::run() {
|
||||
Running_ = true;
|
||||
while (Running_) {
|
||||
Poco::Thread::trySleep(30000);
|
||||
Poco::Thread::trySleep(10000);
|
||||
if (!Running_)
|
||||
break;
|
||||
|
||||
uint64_t Now = Utils::Now();
|
||||
std::lock_guard G(Mutex_);
|
||||
|
||||
std::cout << "Checking sims..." << std::endl;
|
||||
|
||||
for(auto it = Simulations_.begin(); it!=end(Simulations_); ) {
|
||||
const auto &id = it->first;
|
||||
const auto &simulation = it->second;
|
||||
std::cout << "Checking sims..." << std::endl;
|
||||
if (simulation->Details.simulationLength != 0 &&
|
||||
(Now - SimStats()->GetStartTime(id)) > simulation->Details.simulationLength) {
|
||||
std::string Error;
|
||||
std::cout << "Sim is done: " << simulation->Details.name << std::endl;
|
||||
simulation->Runner.Stop();
|
||||
SimStats()->EndSim(id);
|
||||
OWLSObjects::SimulationStatus S;
|
||||
@@ -71,6 +75,7 @@ namespace OpenWifi {
|
||||
SimStats()->RemoveSim(id);
|
||||
it = Simulations_.erase(it);
|
||||
} else {
|
||||
std::cout << "Sim is good: " << simulation->Details.name << std::endl;
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user