Merge "Bypass login page if no user input is required."
[lhc/web/wiklou.git] / includes / libs / rdbms / loadmonitor / LoadMonitor.php
index 499542d..da4909d 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 use Psr\Log\LoggerInterface;
+use Wikimedia\ScopedCallback;
 
 /**
  * Basic DB load monitor with no external dependencies
@@ -160,10 +161,14 @@ class LoadMonitor implements ILoadMonitor {
                                continue;
                        }
 
-                       $lagTimes[$i] = $conn->getLag();
-                       if ( $lagTimes[$i] === false ) {
-                               $host = $this->parent->getServerName( $i );
-                               $this->replLogger->error( __METHOD__ . ": host $host is not replicating?" );
+                       if ( $conn->getLBInfo( 'is static' ) ) {
+                               $lagTimes[$i] = 0;
+                       } else {
+                               $lagTimes[$i] = $conn->getLag();
+                               if ( $lagTimes[$i] === false ) {
+                                       $host = $this->parent->getServerName( $i );
+                                       $this->replLogger->error( __METHOD__ . ": host $host is not replicating?" );
+                               }
                        }
 
                        if ( $close ) {