Use onTransactionIdle() for page invalidations when not using the job queue.
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 16 Apr 2013 17:16:10 +0000 (10:16 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 16 Apr 2013 17:16:10 +0000 (10:16 -0700)
* This will do the page_touched UPDATE in autocommit mode to avoid
  locking a bunch of titles for some unknown amount of time that
  depends on how big the transaction is.

Change-Id: I6ec16a73c11fbf19c24d2b7fe7d01f91b9dcf33a

includes/cache/HTMLCacheUpdate.php

index 791ae3e..992809e 100644 (file)
@@ -62,7 +62,10 @@ class HTMLCacheUpdate implements DeferrableUpdate {
                        JobQueueGroup::singleton()->push( $job );
                        JobQueueGroup::singleton()->deduplicateRootJob( $job );
                } else { // few backlinks ($count might be off even if 0)
-                       $job->run(); // just do the purge query now
+                       $dbw = wfGetDB( DB_MASTER );
+                       $dbw->onTransactionIdle( function() use ( $job ) {
+                               $job->run(); // just do the purge query now
+                       } );
                }
 
                wfProfileOut( __METHOD__ );