r54582 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54581‎ | r54582 | r54583 >
Date:14:05, 7 August 2009
Author:ialex
Status:ok
Tags:
Comment:
* update identation
* added missing "global $wgQueryCacheLimit"
* require QueryPage.php to set $wgQueryPages correctly before using it
Modified paths:
  • /trunk/phase3/maintenance/updateSpecialPages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/updateSpecialPages.php
@@ -32,7 +32,7 @@
3333 }
3434
3535 public function execute() {
36 - global $wgOut, $wgSpecialPageCacheUpdates, $wgQueryPages;
 36+ global $IP, $wgOut, $wgSpecialPageCacheUpdates, $wgQueryPages, $wgQueryCacheLimit;
3737 $wgOut->disable();
3838 $dbw = wfGetDB( DB_MASTER );
3939
@@ -60,6 +60,9 @@
6161 wfWaitForSlaves( 5 );
6262 }
6363
 64+ // This is needed to initialise $wgQueryPages
 65+ require_once( "$IP/includes/QueryPage.php" );
 66+
6467 foreach( $wgQueryPages as $page ) {
6568 @list( $class, $special, $limit ) = $page;
6669
@@ -108,22 +111,22 @@
109112 $this->output( $minutes . 'm ' );
110113 }
111114 $this->output( sprintf( "%.2fs\n", $seconds ) );
112 - }
113 - # Reopen any connections that have closed
114 - if ( !wfGetLB()->pingAll()) {
115 - $this->output( "\n" );
116 - do {
117 - $this->error( "Connection failed, reconnecting in 10 seconds..." );
118 - sleep(10);
119 - } while ( !wfGetLB()->pingAll() );
120 - $this->output( "Reconnected\n\n" );
 115+ }
 116+ # Reopen any connections that have closed
 117+ if ( !wfGetLB()->pingAll()) {
 118+ $this->output( "\n" );
 119+ do {
 120+ $this->error( "Connection failed, reconnecting in 10 seconds..." );
 121+ sleep( 10 );
 122+ } while ( !wfGetLB()->pingAll() );
 123+ $this->output( "Reconnected\n\n" );
 124+ } else {
 125+ # Commit the results
 126+ $dbw->immediateCommit();
 127+ }
 128+ # Wait for the slave to catch up
 129+ wfWaitForSlaves( 5 );
121130 } else {
122 - # Commit the results
123 - $dbw->immediateCommit();
124 - }
125 - # Wait for the slave to catch up
126 - wfWaitForSlaves( 5 );
127 - } else {
128131 $this->output( "cheap, skipped\n" );
129132 }
130133 }

Status & tagging log