From: Tim Starling Date: Mon, 16 Jun 2008 16:19:05 +0000 (+0000) Subject: Use a variable for reporting interval instead of a constant, for inclusion friendliness X-Git-Tag: 1.31.0-rc.0~46999 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=1b424c9343ea26bd05909862bec1893ffef98fa0;p=lhc%2Fweb%2Fwiklou.git Use a variable for reporting interval instead of a constant, for inclusion friendliness --- diff --git a/maintenance/refreshLinks.inc b/maintenance/refreshLinks.inc index e52d1018b4..6d68e27782 100644 --- a/maintenance/refreshLinks.inc +++ b/maintenance/refreshLinks.inc @@ -5,13 +5,10 @@ * @ingroup Maintenance */ -/** */ -define( "REPORTING_INTERVAL", 100 ); -#define( "REPORTING_INTERVAL", 1 ); - function refreshLinks( $start, $newOnly = false, $maxLag = false, $end = 0, $redirectsOnly = false, $oldRedirectsOnly = false ) { global $wgUser, $wgParser, $wgUseTidy; + $reportingInterval = 100; $fname = 'refreshLinks'; $dbr = wfGetDB( DB_SLAVE ); $start = intval( $start ); @@ -42,7 +39,7 @@ function refreshLinks( $start, $newOnly = false, $maxLag = false, $end = 0, $red print "Refreshing $num old redirects from $start...\n"; while( $row = $dbr->fetchObject( $res ) ) { - if ( !( ++$i % REPORTING_INTERVAL ) ) { + if ( !( ++$i % $reportingInterval ) ) { print "$i\n"; wfWaitForSlaves( $maxLag ); } @@ -62,7 +59,7 @@ function refreshLinks( $start, $newOnly = false, $maxLag = false, $end = 0, $red $i = 0; while ( $row = $dbr->fetchObject( $res ) ) { - if ( !( ++$i % REPORTING_INTERVAL ) ) { + if ( !( ++$i % $reportingInterval ) ) { print "$i\n"; wfWaitForSlaves( $maxLag ); } @@ -80,7 +77,7 @@ function refreshLinks( $start, $newOnly = false, $maxLag = false, $end = 0, $red for ($id = $start; $id <= $end; $id++) { - if ( !($id % REPORTING_INTERVAL) ) { + if ( !($id % $reportingInterval) ) { print "$id\n"; wfWaitForSlaves( $maxLag ); }