-function wfWaitForSlaves( $maxLag, $wiki = false ) {
- if( $maxLag ) {
- $lb = wfGetLB( $wiki );
- list( $host, $lag ) = $lb->getMaxLag( $wiki );
- while( $lag > $maxLag ) {
- wfSuppressWarnings();
- $name = gethostbyaddr( $host );
- wfRestoreWarnings();
- if( $name !== false ) {
- $host = $name;
- }
- print "Waiting for $host (lagged $lag seconds)...\n";
- sleep( $maxLag );
- list( $host, $lag ) = $lb->getMaxLag();
- }
- }
-}
-
-/**
- * Modern version of wfWaitForSlaves(). Instead of looking at replication lag
- * and waiting for it to go down, this waits for the slaves to catch up to the
- * master position. This is much better for lag control than wfWaitForSlaves()
- */
-function wfWaitForSlaves_masterPos() {