Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/247287

Change subject: Avoid using redundant newSimplePurge() method
......................................................................

Avoid using redundant newSimplePurge() method

Change-Id: I79026dcea4b2f761660909d4cd9b23dc42b82a85
---
M ImageTaggingHooks.php
1 file changed, 4 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ImageTagging 
refs/changes/87/247287/1

diff --git a/ImageTaggingHooks.php b/ImageTaggingHooks.php
index 56d5c5e..6ee3cc7 100644
--- a/ImageTaggingHooks.php
+++ b/ImageTaggingHooks.php
@@ -316,21 +316,15 @@
        public static function purgeTitle( $title ) {
                global $wgUseSquid;
 
-               wfProfileIn( __METHOD__ );
-
                $title->invalidateCache();
 
                if ( $wgUseSquid ) {
                        // Commit the transaction before the purge is sent
-                       $dbw = wfGetDB( DB_MASTER );
-                       $dbw->commit();
-
-                       // Send purge
-                       $update = SquidUpdate::newSimplePurge( $title );
-                       $update->doUpdate();
+                       wfGetDB( DB_MASTER )->onTransactionIdle( function () 
use ( $title ) {
+                               $update = new SquidUpdate( 
$title->getSquidURLs() );
+                               $update->doUpdate();
+                       } );
                }
-
-               wfProfileOut( __METHOD__ );
        }
 
        public static function getImageTags( $img, $imgName ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/247287
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I79026dcea4b2f761660909d4cd9b23dc42b82a85
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ImageTagging
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to