From: Tim Starling Date: Sun, 19 Jun 2005 01:09:02 +0000 (+0000) Subject: wait for slaves X-Git-Tag: 1.5.0beta1~158 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=7ba3286102844e6b7eb1dcb3b90343f83c7e2bc4;p=lhc%2Fweb%2Fwiklou.git wait for slaves --- diff --git a/maintenance/updateSpecialPages.php b/maintenance/updateSpecialPages.php index 97967b39ca..5b30fa5399 100644 --- a/maintenance/updateSpecialPages.php +++ b/maintenance/updateSpecialPages.php @@ -62,6 +62,15 @@ foreach ( $wgQueryPages as $page ) { # Commit the results $dbw->immediateCommit(); } + + # Wait for the slave to catch up + $slaveDB =& wfGetDB( DB_SLAVE, array('QueryPage::recache', 'vslow' ) ); + while( $slaveDB->getLag() > 600 ) { + print "Slave lagged, waiting...\n"; + sleep(30); + + } + } else { print "cheap, skipped\n"; }