From fb825dea83357f8331ba8952102b884e7f5c3367 Mon Sep 17 00:00:00 2001 From: Bertrand Grondin Date: Tue, 18 Mar 2008 07:58:21 +0000 Subject: [PATCH] Fix bug when using Mediawiki Installer. fix the following message error : Fatal error: Call to undefined function wfWaitForSlaves() in maintenance/populateCategory.inc on line 66 This wfWaitForSlaves() function exists only in commandLine.inc but updater can't call it when not using command line tool. Adding this function in the end of populateCategory.inc. --- maintenance/populateCategory.inc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/maintenance/populateCategory.inc b/maintenance/populateCategory.inc index f17e5e827f..905706ed39 100644 --- a/maintenance/populateCategory.inc +++ b/maintenance/populateCategory.inc @@ -82,3 +82,19 @@ function populateCategory( $begin, $maxlag, $throttle, $force ) { return false; } } + +function wfWaitForSlaves( $maxLag ) { + global $wgLoadBalancer; + if ( $maxLag ) { + list( $host, $lag ) = $wgLoadBalancer->getMaxLag(); + while ( $lag > $maxLag ) { + $name = @gethostbyaddr( $host ); + if ( $name !== false ) { + $host = $name; + } + print "Waiting for $host (lagged $lag seconds)...\n"; + sleep($maxLag); + list( $host, $lag ) = $wgLoadBalancer->getMaxLag(); + } + } +} -- 2.20.1