Cleaner TS input shutdown

This commit is contained in:
Thulinma 2018-02-07 10:56:06 +01:00
parent 21860c9bbe
commit 106967515a

View file

@ -495,6 +495,7 @@ namespace Mist {
if (statsPage.getData()){ if (statsPage.getData()){
if (!statsPage.isAlive()){ if (!statsPage.isAlive()){
config->is_active = false; config->is_active = false;
statsPage.finish();
return "received shutdown request from controller"; return "received shutdown request from controller";
} }
IPC::statExchange tmpEx(statsPage.getData()); IPC::statExchange tmpEx(statsPage.getData());
@ -516,6 +517,7 @@ namespace Mist {
if (hasStarted && !threadTimer.size()){ if (hasStarted && !threadTimer.size()){
if (!isAlwaysOn()){ if (!isAlwaysOn()){
config->is_active = false; config->is_active = false;
statsPage.finish();
return "no active threads and we had input in the past"; return "no active threads and we had input in the past";
}else{ }else{
hasStarted = false; hasStarted = false;
@ -546,12 +548,14 @@ namespace Mist {
if (Util::bootSecs() - noDataSince > 20){ if (Util::bootSecs() - noDataSince > 20){
if (!isAlwaysOn()){ if (!isAlwaysOn()){
config->is_active = false; config->is_active = false;
statsPage.finish();
return "No packets received for 20 seconds - terminating"; return "No packets received for 20 seconds - terminating";
}else{ }else{
noDataSince = Util::bootSecs(); noDataSince = Util::bootSecs();
} }
} }
} }
statsPage.finish();
return "received shutdown request"; return "received shutdown request";
} }