From 1d34f78d94e72b41c804974b3bc61a989fe3e7ab Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Santoro?= Date: Fri, 1 Apr 2016 11:35:40 +0000 Subject: [PATCH] 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 --- includes/SiteStats.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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' ); } } -- 2.20.1