Details
Description
private boolean pastReconnThreshold() {
|
long currentTime = System.nanoTime();
|
if (currentTime - thresholdLastCheck > 100000000) { //if longer than 10 sec
|
configThresholdCount = 0; // it's been more than 10 sec since last
|
// tried, so don't try again just yet.
|
}
|
configThresholdCount++;
|
thresholdLastCheck = currentTime;
|
|
if (configThresholdCount >= maxConfigCheck) {
|
return true;
|
}
|
return false;
|
}
|
Does the above really work as expected? It looks strange. 100000000 in nanos is only 100 millis and not 10 seconds as stated in comments.
If there is more than 100 millis between calls we always reset configThresholdCount and will never return true, which seems very strange.