Index: trunk/phase3/maintenance/updateSpecialPages.php |
— | — | @@ -32,7 +32,7 @@ |
33 | 33 | } |
34 | 34 | |
35 | 35 | public function execute() { |
36 | | - global $wgOut, $wgSpecialPageCacheUpdates, $wgQueryPages; |
| 36 | + global $IP, $wgOut, $wgSpecialPageCacheUpdates, $wgQueryPages, $wgQueryCacheLimit; |
37 | 37 | $wgOut->disable(); |
38 | 38 | $dbw = wfGetDB( DB_MASTER ); |
39 | 39 | |
— | — | @@ -60,6 +60,9 @@ |
61 | 61 | wfWaitForSlaves( 5 ); |
62 | 62 | } |
63 | 63 | |
| 64 | + // This is needed to initialise $wgQueryPages |
| 65 | + require_once( "$IP/includes/QueryPage.php" ); |
| 66 | + |
64 | 67 | foreach( $wgQueryPages as $page ) { |
65 | 68 | @list( $class, $special, $limit ) = $page; |
66 | 69 | |
— | — | @@ -108,22 +111,22 @@ |
109 | 112 | $this->output( $minutes . 'm ' ); |
110 | 113 | } |
111 | 114 | $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 ); |
121 | 130 | } else { |
122 | | - # Commit the results |
123 | | - $dbw->immediateCommit(); |
124 | | - } |
125 | | - # Wait for the slave to catch up |
126 | | - wfWaitForSlaves( 5 ); |
127 | | - } else { |
128 | 131 | $this->output( "cheap, skipped\n" ); |
129 | 132 | } |
130 | 133 | } |