jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/373325 )
Change subject: Make workItemCount() smarter for htmlCacheUpdate/refreshLinks
......................................................................
Make workItemCount() smarter for htmlCacheUpdate/refreshLinks
Do not count jobs that just make subdivide as having any
"work items". This makes $wgJobBackoffThrottling less
overzealous when used to limit these type of jobs.
The main reason to limit htmlCacheUpdate would be for
CDN purge rate limiting. For refreshLinks, it would
mostly be lag, though that is already handled for
leaf jobs and JobRunner itself.
Bug: T173710
Change-Id: Ide831b555e51e3111410929a598efb6c0afc0989
---
M includes/jobqueue/jobs/HTMLCacheUpdateJob.php
M includes/jobqueue/jobs/RefreshLinksJob.php
2 files changed, 14 insertions(+), 2 deletions(-)
Approvals:
Aaron Schulz: Looks good to me, approved
Legoktm: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/jobqueue/jobs/HTMLCacheUpdateJob.php
b/includes/jobqueue/jobs/HTMLCacheUpdateJob.php
index 2d816f9..07d68e7 100644
--- a/includes/jobqueue/jobs/HTMLCacheUpdateJob.php
+++ b/includes/jobqueue/jobs/HTMLCacheUpdateJob.php
@@ -152,6 +152,12 @@
}
public function workItemCount() {
- return isset( $this->params['pages'] ) ? count(
$this->params['pages'] ) : 1;
+ if ( !empty( $this->params['recursive'] ) ) {
+ return 0; // nothing actually purged
+ } elseif ( isset( $this->params['pages'] ) ) {
+ return count( $this->params['pages'] );
+ }
+
+ return 1; // one title
}
}
diff --git a/includes/jobqueue/jobs/RefreshLinksJob.php
b/includes/jobqueue/jobs/RefreshLinksJob.php
index b4ead5d..9f3550f 100644
--- a/includes/jobqueue/jobs/RefreshLinksJob.php
+++ b/includes/jobqueue/jobs/RefreshLinksJob.php
@@ -301,6 +301,12 @@
}
public function workItemCount() {
- return isset( $this->params['pages'] ) ? count(
$this->params['pages'] ) : 1;
+ if ( !empty( $this->params['recursive'] ) ) {
+ return 0; // nothing actually refreshed
+ } elseif ( isset( $this->params['pages'] ) ) {
+ return count( $this->params['pages'] );
+ }
+
+ return 1; // one title
}
}
--
To view, visit https://gerrit.wikimedia.org/r/373325
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ide831b555e51e3111410929a598efb6c0afc0989
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits