From: Sébastien Santoro Date: Fri, 1 Apr 2016 11:35:40 +0000 (+0000) Subject: Allow SiteStatsInit to run on vslow hosts X-Git-Tag: 1.31.0-rc.0~7422^2 X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28?a=commitdiff_plain;h=1d34f78d94e72b41c804974b3bc61a989fe3e7ab;p=lhc%2Fweb%2Fwiklou.git Allow SiteStatsInit to run on vslow hosts SiteStatsInits queries could be long running, and so lead to buffers and undo table issues. This change allows SiteStatsInits to connect to vslow host. Bug: T131475 Change-Id: I63c643ef3cc12f38c24374592c55364ba7569a26 --- diff --git a/includes/SiteStats.php b/includes/SiteStats.php index 580f7ccb19..74c2997525 100644 --- a/includes/SiteStats.php +++ b/includes/SiteStats.php @@ -289,8 +289,10 @@ class SiteStatsInit { public function __construct( $database = false ) { if ( $database instanceof IDatabase ) { $this->db = $database; + } elseif ( $database ) { + $this->db = wfGetDB( DB_MASTER ); } else { - $this->db = wfGetDB( $database ? DB_MASTER : DB_SLAVE ); + $this->db = wfGetDB( DB_SLAVE, 'vslow' ); } }