From: Aaron Schulz Date: Tue, 30 Aug 2016 22:32:09 +0000 (-0700) Subject: objectcache: Make SqlBagOStuff::waitForSlaves() no-op without slaves X-Git-Tag: 1.31.0-rc.0~5825^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=e92cefafdf70b380a0882b2fbe3250860769c986;p=lhc%2Fweb%2Fwiklou.git objectcache: Make SqlBagOStuff::waitForSlaves() no-op without slaves Change-Id: Ibaa4745c18c6f4f66edb4c5f190196b575d3b738 --- diff --git a/includes/objectcache/SqlBagOStuff.php b/includes/objectcache/SqlBagOStuff.php index 7a89991679..73f8280d32 100644 --- a/includes/objectcache/SqlBagOStuff.php +++ b/includes/objectcache/SqlBagOStuff.php @@ -801,6 +801,10 @@ class SqlBagOStuff extends BagOStuff { if ( $this->usesMainDB() ) { $lb = $this->getSeparateMainLB() ?: MediaWikiServices::getInstance()->getDBLoadBalancer(); + // Return if there are no slaves + if ( $lb->getServerCount() <= 1 ) { + return true; + } // Main LB is used; wait for any slaves to catch up try { $pos = $lb->getMasterPos();