Fixed timestamp comparison in fixUserRegistration
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 17 Mar 2015 02:33:25 +0000 (19:33 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 17 Mar 2015 02:33:25 +0000 (19:33 -0700)
* Also optimized batching logic slightly

Change-Id: I0cedb5b39f996b7baec067890f230cff51468e4b

maintenance/fixUserRegistration.php

index 0120f35..43f4b6c 100644 (file)
@@ -66,7 +66,7 @@ class FixUserRegistration extends Maintenance {
                                        __METHOD__
                                );
                                // Update
-                               if ( $timestamp !== false ) {
+                               if ( $timestamp !== null ) {
                                        $dbw->update(
                                                'user',
                                                array( 'user_registration' => $timestamp ),
@@ -83,7 +83,7 @@ class FixUserRegistration extends Maintenance {
                        $this->output( "Waiting for slaves..." );
                        wfWaitForSlaves();
                        $this->output( " done.\n" );
-               } while ( $res->numRows() );
+               } while ( $res->numRows() >= $this->mBatchSize );
        }
 }