r36339 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36338‎ | r36339 | r36340 >
Date:16:19, 16 June 2008
Author:tstarling
Status:old
Tags:
Comment:
Use a variable for reporting interval instead of a constant, for inclusion friendliness
Modified paths:
  • /trunk/phase3/maintenance/refreshLinks.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/refreshLinks.inc
@@ -5,13 +5,10 @@
66 * @ingroup Maintenance
77 */
88
9 -/** */
10 -define( "REPORTING_INTERVAL", 100 );
11 -#define( "REPORTING_INTERVAL", 1 );
12 -
139 function refreshLinks( $start, $newOnly = false, $maxLag = false, $end = 0, $redirectsOnly = false, $oldRedirectsOnly = false ) {
1410 global $wgUser, $wgParser, $wgUseTidy;
1511
 12+ $reportingInterval = 100;
1613 $fname = 'refreshLinks';
1714 $dbr = wfGetDB( DB_SLAVE );
1815 $start = intval( $start );
@@ -42,7 +39,7 @@
4340 print "Refreshing $num old redirects from $start...\n";
4441
4542 while( $row = $dbr->fetchObject( $res ) ) {
46 - if ( !( ++$i % REPORTING_INTERVAL ) ) {
 43+ if ( !( ++$i % $reportingInterval ) ) {
4744 print "$i\n";
4845 wfWaitForSlaves( $maxLag );
4946 }
@@ -62,7 +59,7 @@
6360
6461 $i = 0;
6562 while ( $row = $dbr->fetchObject( $res ) ) {
66 - if ( !( ++$i % REPORTING_INTERVAL ) ) {
 63+ if ( !( ++$i % $reportingInterval ) ) {
6764 print "$i\n";
6865 wfWaitForSlaves( $maxLag );
6966 }
@@ -80,7 +77,7 @@
8178
8279 for ($id = $start; $id <= $end; $id++) {
8380
84 - if ( !($id % REPORTING_INTERVAL) ) {
 81+ if ( !($id % $reportingInterval) ) {
8582 print "$id\n";
8683 wfWaitForSlaves( $maxLag );
8784 }

Status & tagging log