*Fix bug when using Mediawiki updater command line.
authorBertrand Grondin <grondin@users.mediawiki.org>
Tue, 18 Mar 2008 12:42:22 +0000 (12:42 +0000)
committerBertrand Grondin <grondin@users.mediawiki.org>
Tue, 18 Mar 2008 12:42:22 +0000 (12:42 +0000)
*Prevent redeclaring wfWaitForSlaves ()

maintenance/populateCategory.inc

index 905706e..497f4b5 100644 (file)
@@ -4,6 +4,8 @@
  * @author Simetrical
  */
 
+require_once "commandLine.inc";
+
 define( 'REPORTING_INTERVAL', 1000 );
 
 function populateCategory( $begin, $maxlag, $throttle, $force ) {
@@ -82,19 +84,3 @@ 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();
-               }
-       }
-}