jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/374564 )
Change subject: Batch request titles for cdn purge from db
......................................................................
Batch request titles for cdn purge from db
Xenon shows a significant amount of time is spent individually fetching
the content model for titles being purged. It's probably not a huge
improvement but lets fetch them all in one go instead of lazily as
needed.
Change-Id: I71af6f13c84e740c1367617d7a51210501363b33
---
M includes/cache/LinkBatch.php
M includes/deferred/CdnCacheUpdate.php
2 files changed, 3 insertions(+), 2 deletions(-)
Approvals:
Aaron Schulz: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/cache/LinkBatch.php b/includes/cache/LinkBatch.php
index 38cb6be..30d105b 100644
--- a/includes/cache/LinkBatch.php
+++ b/includes/cache/LinkBatch.php
@@ -43,7 +43,7 @@
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 ) {
diff --git a/includes/deferred/CdnCacheUpdate.php
b/includes/deferred/CdnCacheUpdate.php
index 470086a..7fafc0e 100644
--- a/includes/deferred/CdnCacheUpdate.php
+++ b/includes/deferred/CdnCacheUpdate.php
@@ -49,11 +49,12 @@
/**
* 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() );
--
To view, visit https://gerrit.wikimedia.org/r/374564
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I71af6f13c84e740c1367617d7a51210501363b33
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits