unset( $loads[$i] );
$sleepTime = 0;
} else {
- $status = $this->mConnections[$i]->getStatus("Thread%");
- if ( isset( $this->mServers[$i]['max threads'] ) &&
- $status['Threads_running'] > $this->mServers[$i]['max threads'] )
- {
+ if ( isset( $this->mServers[$i]['max threads'] ) ) {
+ $status = $this->mConnections[$i]->getStatus("Thread%");
+ if ( $status['Threads_running'] > $this->mServers[$i]['max threads'] ) {
# Too much load, back off and wait for a while.
# The sleep time is scaled by the number of threads connected,
# to produce a roughly constant global poll rate.
# If we reach the timeout and exit the loop, don't use it
$i = false;
- } else {
+ } else {
$done = true;
$sleepTime = 0;
+ }
+ } else {
+ $done = true;
+ $sleepTime = 0;
}
}
} else {