Disable rebound CDN purges for backlinks in HTMLCacheUpdateJob
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 24 Aug 2017 22:10:19 +0000 (15:10 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 24 Aug 2017 22:10:21 +0000 (15:10 -0700)
These are there to handle regeneration race conditions due to
replication lag. If there happens to already be a huge amount
of purges, the cost of this can be too high. Also, if the queue
is backlogged, then it is already delayed, so extra delayed jobs
do not help and just add to the backlog in that scenario.

Bug: T173710
Change-Id: Ida0bf44233072e1356a9fe63866d522e4bb2d0ca

includes/jobqueue/jobs/HTMLCacheUpdateJob.php

index 07d68e7..9d0f87c 100644 (file)
@@ -139,9 +139,13 @@ class HTMLCacheUpdateJob extends Job {
                        __METHOD__
                ) );
 
-               // Update CDN
-               $u = CdnCacheUpdate::newFromTitles( $titleArray );
-               $u->doUpdate();
+               // Update CDN; call purge() directly so as to not bother with secondary purges
+               $urls = [];
+               foreach ( $titleArray as $title ) {
+                       /** @var Title $title */
+                       $urls = array_merge( $urls, $title->getCdnUrls() );
+               }
+               CdnCacheUpdate::purge( $urls );
 
                // Update file cache
                if ( $wgUseFileCache ) {