Made HTMLCacheUpdateJob flush the trx between jobs
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 24 Sep 2015 18:26:54 +0000 (11:26 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 24 Sep 2015 18:26:54 +0000 (11:26 -0700)
Bug: T95501
Change-Id: I899c7a0467927dd862c651de6811acdfc340b3db

includes/jobqueue/jobs/HTMLCacheUpdateJob.php

index a9010c2..ef9fec0 100644 (file)
@@ -85,8 +85,6 @@ class HTMLCacheUpdateJob extends Job {
                        return;
                }
 
-               $dbw = wfGetDB( DB_MASTER );
-
                // The page_touched field will need to be bumped for these pages.
                // Only bump it to the present time if no "rootJobTimestamp" was known.
                // If it is known, it can be used instead, which avoids invalidating output
@@ -100,9 +98,12 @@ class HTMLCacheUpdateJob extends Job {
                        $touchTimestamp = wfTimestampNow();
                }
 
+               $dbw = wfGetDB( DB_MASTER );
                // Update page_touched (skipping pages already touched since the root job).
                // Check $wgUpdateRowsPerQuery for sanity; batch jobs are sized by that already.
                foreach ( array_chunk( $pageIds, $wgUpdateRowsPerQuery ) as $batch ) {
+                       $dbw->commit( __METHOD__, 'flush' );
+
                        $dbw->update( 'page',
                                array( 'page_touched' => $dbw->timestamp( $touchTimestamp ) ),
                                array( 'page_id' => $batch,