From: Max Semenik Date: Wed, 20 Sep 2017 03:38:20 +0000 (-0700) Subject: Improve populateIpChanges.php reporting X-Git-Tag: 1.31.0-rc.0~2024^2 X-Git-Url: https://git.heureux-cyclage.org/index.php?a=commitdiff_plain;h=06913b853ddb971e400c2bf3829fa4b40c260afa;p=lhc%2Fweb%2Fwiklou.git Improve populateIpChanges.php reporting Instead of just the rows we attempted to insert, also count actually inserted ones. Change-Id: Ie747cb41873640776281794a90dbe3b6b8e3fa84 --- diff --git a/maintenance/populateIpChanges.php b/maintenance/populateIpChanges.php index f7bcc12c3d..2b2a2b433d 100644 --- a/maintenance/populateIpChanges.php +++ b/maintenance/populateIpChanges.php @@ -72,7 +72,8 @@ TEXT ? $maxRevId : $dbw->selectField( 'revision', 'MAX(rev_id)', false, __METHOD__ ); $blockStart = $start; - $revCount = 0; + $attempted = 0; + $inserted = 0; $this->output( "Copying IP revisions to ip_changes, from rev_id $start to rev_id $end\n" ); @@ -105,7 +106,7 @@ TEXT 'ipc_hex' => IP::toHex( $row->rev_user_text ), ]; - $revCount++; + $attempted++; } } @@ -116,13 +117,15 @@ TEXT 'IGNORE' ); + $inserted += $dbw->affectedRows(); + $lbFactory->waitForReplication(); usleep( $throttle * 1000 ); $blockStart = $blockEnd + 1; } - $this->output( "$revCount IP revisions copied.\n" ); + $this->output( "Attempted to insert $attempted IP revisions, $inserted actually done.\n" ); return true; }