Merge "Batch request titles for cdn purge from db"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 30 Aug 2017 18:38:11 +0000 (18:38 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 30 Aug 2017 18:38:11 +0000 (18:38 +0000)
includes/cache/LinkBatch.php
includes/deferred/CdnCacheUpdate.php

index 38cb6be..30d105b 100644 (file)
@@ -43,7 +43,7 @@ class LinkBatch {
        protected $caller;
 
        /**
-        * @param LinkTarget[] $arr Initial items to be added to the batch
+        * @param Traversable|LinkTarget[] $arr Initial items to be added to the batch
         */
        public function __construct( $arr = [] ) {
                foreach ( $arr as $item ) {
index 470086a..7fafc0e 100644 (file)
@@ -49,11 +49,12 @@ class CdnCacheUpdate implements DeferrableUpdate, MergeableUpdate {
        /**
         * Create an update object from an array of Title objects, or a TitleArray object
         *
-        * @param Traversable|array $titles
+        * @param Traversable|Title[] $titles
         * @param string[] $urlArr
         * @return CdnCacheUpdate
         */
        public static function newFromTitles( $titles, $urlArr = [] ) {
+               ( new LinkBatch( $titles ) )->execute();
                /** @var Title $title */
                foreach ( $titles as $title ) {
                        $urlArr = array_merge( $urlArr, $title->getCdnUrls() );