delay check only if scan succeeded
This commit is contained in:
@@ -317,13 +317,13 @@ void MainLoop::run() {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
scanStatus = SCAN_STATUS_RUNNING;
|
scanStatus = SCAN_STATUS_RUNNING;
|
||||||
nextCheckRun = now + CHECK_INITIAL_DELAY;
|
|
||||||
result_t result = m_busHandler->scanAndWait(lastScanAddress, true);
|
result_t result = m_busHandler->scanAndWait(lastScanAddress, true);
|
||||||
taskDelay = (result == RESULT_ERR_NO_SIGNAL) ? 10 : 1;
|
taskDelay = (result == RESULT_ERR_NO_SIGNAL) ? 10 : 1;
|
||||||
if (result != RESULT_OK) {
|
if (result != RESULT_OK) {
|
||||||
logError(lf_main, "scan config %2.2x: %s", lastScanAddress, getResultCode(result));
|
logError(lf_main, "scan config %2.2x: %s", lastScanAddress, getResultCode(result));
|
||||||
} else {
|
} else {
|
||||||
logInfo(lf_main, "scan config %2.2x message received", lastScanAddress);
|
logInfo(lf_main, "scan config %2.2x message received", lastScanAddress);
|
||||||
|
nextCheckRun = now + CHECK_INITIAL_DELAY; // delay update check due to new scan data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -354,6 +354,7 @@ void MainLoop::run() {
|
|||||||
#endif
|
#endif
|
||||||
PACKAGE_NAME "/" PACKAGE_VERSION)) {
|
PACKAGE_NAME "/" PACKAGE_VERSION)) {
|
||||||
logError(lf_main, "update check connect error");
|
logError(lf_main, "update check connect error");
|
||||||
|
nextCheckRun = now + CHECK_INITIAL_DELAY;
|
||||||
} else {
|
} else {
|
||||||
ostringstream ostr;
|
ostringstream ostr;
|
||||||
ostr << "{\"v\":\"" PACKAGE_VERSION "\",\"r\":\"" REVISION << "\""
|
ostr << "{\"v\":\"" PACKAGE_VERSION "\",\"r\":\"" REVISION << "\""
|
||||||
@@ -394,8 +395,8 @@ void MainLoop::run() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
nextCheckRun = now + CHECK_DELAY;
|
||||||
}
|
}
|
||||||
nextCheckRun = now + CHECK_DELAY;
|
|
||||||
}
|
}
|
||||||
time(&lastTaskRun);
|
time(&lastTaskRun);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user