$lagTimes = $this->getLagTimes( $wiki );
foreach ( $lagTimes as $i => $lag ) {
- if ( $lag > $maxLag ) {
+ if ( $this->mLoads[$i] > 0 && $lag > $maxLag ) {
$maxLag = $lag;
$host = $this->mServers[$i]['host'];
$maxIndex = $i;
}
$pos = $pos ?: $this->getConnection( DB_MASTER )->getMasterPos();
- if ( !$pos ) {
+ if ( !( $pos instanceof DBMasterPos ) ) {
return false; // something is misconfigured
}