Merge "Exclude redirects from Special:Fewestrevisions"
[lhc/web/wiklou.git] / includes / libs / rdbms / loadmonitor / LoadMonitorMySQL.php
index f8ad329..5ae5bbd 100644 (file)
@@ -39,22 +39,20 @@ class LoadMonitorMySQL extends LoadMonitor {
        ) {
                parent::__construct( $lb, $srvCache, $wCache, $options );
 
-               $this->warmCacheRatio = isset( $options['warmCacheRatio'] )
-                       ? $options['warmCacheRatio']
-                       : 0.0;
+               $this->warmCacheRatio = $options['warmCacheRatio'] ?? 0.0;
        }
 
        protected function getWeightScale( $index, IDatabase $conn = null ) {
                if ( !$conn ) {
-                       return 0.0;
+                       return parent::getWeightScale( $index, $conn );
                }
 
                $weight = 1.0;
                if ( $this->warmCacheRatio > 0 ) {
-                       $res = $conn->query( 'SHOW STATUS', false );
+                       $res = $conn->query( 'SHOW STATUS', __METHOD__ );
                        $s = $res ? $conn->fetchObject( $res ) : false;
                        if ( $s === false ) {
-                               $host = $this->parent->getServerName( $index );
+                               $host = $this->lb->getServerName( $index );
                                $this->replLogger->error( __METHOD__ . ": could not get status for $host" );
                        } else {
                                // https://dev.mysql.com/doc/refman/5.7/en/server-status-variables.html