Merge "Replace uses of each()"
[lhc/web/wiklou.git] / maintenance / populateIpChanges.php
index f7bcc12..2b2a2b4 100644 (file)
@@ -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;
        }