TS input now correctly obeys always-on setting.

This commit is contained in:
Thulinma 2017-06-10 11:26:04 +02:00
parent 7bbec5323e
commit 9405c8931c

View file

@ -390,8 +390,12 @@ namespace Mist {
IPC::semaphore lock(semName, O_CREAT | O_RDWR, ACCESSPERMS, 1); IPC::semaphore lock(semName, O_CREAT | O_RDWR, ACCESSPERMS, 1);
lock.wait(); lock.wait();
if (hasStarted && !threadTimer.size()){ if (hasStarted && !threadTimer.size()){
INFO_MSG("Shutting down because no active threads and we had input in the past"); if (!isAlwaysOn()){
config->is_active = false; INFO_MSG("Shutting down because no active threads and we had input in the past");
config->is_active = false;
}else{
hasStarted = false;
}
} }
for (std::set<unsigned long>::iterator it = activeTracks.begin(); it != activeTracks.end(); it++) { for (std::set<unsigned long>::iterator it = activeTracks.begin(); it != activeTracks.end(); it++) {
if (threadTimer.count(*it) && ((Util::bootSecs() - threadTimer[*it]) > (2 * THREAD_TIMEOUT))) { if (threadTimer.count(*it) && ((Util::bootSecs() - threadTimer[*it]) > (2 * THREAD_TIMEOUT))) {
@ -417,8 +421,12 @@ namespace Mist {
if (!inFile){ if (!inFile){
Util::sleep(100); Util::sleep(100);
if (Util::bootSecs() - noDataSince > 20){ if (Util::bootSecs() - noDataSince > 20){
WARN_MSG("No packets received for 20 seconds - terminating"); if (!isAlwaysOn()){
config->is_active = false; WARN_MSG("No packets received for 20 seconds - terminating");
config->is_active = false;
}else{
noDataSince = Util::bootSecs();
}
} }
} }
} }