* update identation

* added missing "global $wgQueryCacheLimit"
* require QueryPage.php to set $wgQueryPages correctly before using it
This commit is contained in:
Alexandre Emsenhuber 2009-08-07 14:05:26 +00:00
parent 5a35ac62e7
commit 9898872283

View file

@ -32,7 +32,7 @@ class UpdateSpecialPages extends Maintenance {
}
public function execute() {
global $wgOut, $wgSpecialPageCacheUpdates, $wgQueryPages;
global $IP, $wgOut, $wgSpecialPageCacheUpdates, $wgQueryPages, $wgQueryCacheLimit;
$wgOut->disable();
$dbw = wfGetDB( DB_MASTER );
@ -60,6 +60,9 @@ class UpdateSpecialPages extends Maintenance {
wfWaitForSlaves( 5 );
}
// This is needed to initialise $wgQueryPages
require_once( "$IP/includes/QueryPage.php" );
foreach( $wgQueryPages as $page ) {
@list( $class, $special, $limit ) = $page;
@ -108,21 +111,21 @@ class UpdateSpecialPages extends Maintenance {
$this->output( $minutes . 'm ' );
}
$this->output( sprintf( "%.2fs\n", $seconds ) );
}
# Reopen any connections that have closed
if ( !wfGetLB()->pingAll()) {
$this->output( "\n" );
do {
$this->error( "Connection failed, reconnecting in 10 seconds..." );
sleep(10);
} while ( !wfGetLB()->pingAll() );
$this->output( "Reconnected\n\n" );
} else {
# Commit the results
$dbw->immediateCommit();
}
# Wait for the slave to catch up
wfWaitForSlaves( 5 );
}
# Reopen any connections that have closed
if ( !wfGetLB()->pingAll()) {
$this->output( "\n" );
do {
$this->error( "Connection failed, reconnecting in 10 seconds..." );
sleep( 10 );
} while ( !wfGetLB()->pingAll() );
$this->output( "Reconnected\n\n" );
} else {
# Commit the results
$dbw->immediateCommit();
}
# Wait for the slave to catch up
wfWaitForSlaves( 5 );
} else {
$this->output( "cheap, skipped\n" );
}