X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=blobdiff_plain;f=includes%2Fjobqueue%2Fjobs%2FHTMLCacheUpdateJob.php;h=4c16d7f25b7ac3594c9fd48a39ddfe89d2f897c0;hb=cb7c910ba72bdf4c2c2f5fa7e7dd307f98e5138e;hp=07d68e76f53f68c71bf7172d8726b36b77e060b6;hpb=b95ca29602793f39191c06cd6941e3f32ab1bbb8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/jobqueue/jobs/HTMLCacheUpdateJob.php b/includes/jobqueue/jobs/HTMLCacheUpdateJob.php index 07d68e76f5..4c16d7f25b 100644 --- a/includes/jobqueue/jobs/HTMLCacheUpdateJob.php +++ b/includes/jobqueue/jobs/HTMLCacheUpdateJob.php @@ -113,6 +113,10 @@ class HTMLCacheUpdateJob extends Job { // before the link jobs, so using the current timestamp instead of the root timestamp is // not expected to invalidate these cache entries too often. $touchTimestamp = wfTimestampNow(); + // If page_touched is higher than this, then something else already bumped it after enqueue + $condTimestamp = isset( $this->params['rootJobTimestamp'] ) + ? $this->params['rootJobTimestamp'] + : $touchTimestamp; $dbw = wfGetDB( DB_MASTER ); $factory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); @@ -126,7 +130,7 @@ class HTMLCacheUpdateJob extends Job { [ 'page_touched' => $dbw->timestamp( $touchTimestamp ) ], [ 'page_id' => $batch, // don't invalidated pages that were already invalidated - "page_touched < " . $dbw->addQuotes( $dbw->timestamp( $touchTimestamp ) ) + "page_touched < " . $dbw->addQuotes( $dbw->timestamp( $condTimestamp ) ) ], __METHOD__ ); @@ -139,9 +143,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 ) {