aboutsummaryrefslogtreecommitdiffstats
path: root/includes/poolcounter
diff options
context:
space:
mode:
authorAmir Sarabadani <ladsgroup@gmail.com>2022-03-30 22:23:01 +0200
committerKrinkle <krinkle@fastmail.com>2022-04-01 14:02:07 +0000
commita087f79319043c5e20c1b25da89b79bba0f63a8b (patch)
treef78a1ed327370a89cd4982a130927416371c2364 /includes/poolcounter
parentc41191620ed04fa303e994f20db5814951a3f6d5 (diff)
downloadmediawikicore-a087f79319043c5e20c1b25da89b79bba0f63a8b.tar.gz
mediawikicore-a087f79319043c5e20c1b25da89b79bba0f63a8b.zip
ParserOutputAccess: Allow calling getPO with option of not saving in PC
This is needed to make sure CirrusSearch doesn't overwhelm parsercache. Follows-up I23c053df4c (T302620). Bug: T285993 Change-Id: Ia5fc3b063c45cb43fdee16f44da2270847773945
Diffstat (limited to 'includes/poolcounter')
-rw-r--r--includes/poolcounter/PoolWorkArticleViewCurrent.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/includes/poolcounter/PoolWorkArticleViewCurrent.php b/includes/poolcounter/PoolWorkArticleViewCurrent.php
index e567d3a49f61..95cb60130c87 100644
--- a/includes/poolcounter/PoolWorkArticleViewCurrent.php
+++ b/includes/poolcounter/PoolWorkArticleViewCurrent.php
@@ -57,6 +57,7 @@ class PoolWorkArticleViewCurrent extends PoolWorkArticleView {
* @param ILBFactory $lbFactory
* @param LoggerSpi $loggerSpi
* @param WikiPageFactory $wikiPageFactory
+ * @param bool $cacheable Whether it should store the result in cache or not
*/
public function __construct(
string $workKey,
@@ -67,7 +68,8 @@ class PoolWorkArticleViewCurrent extends PoolWorkArticleView {
ParserCache $parserCache,
ILBFactory $lbFactory,
LoggerSpi $loggerSpi,
- WikiPageFactory $wikiPageFactory
+ WikiPageFactory $wikiPageFactory,
+ bool $cacheable = true
) {
// TODO: Remove support for partially initialized RevisionRecord instances once
// Article no longer uses fake revisions.
@@ -82,7 +84,7 @@ class PoolWorkArticleViewCurrent extends PoolWorkArticleView {
$this->parserCache = $parserCache;
$this->lbFactory = $lbFactory;
$this->wikiPageFactory = $wikiPageFactory;
- $this->cacheable = true;
+ $this->cacheable = $cacheable;
}
/**