Remove wgTemporaryParsoidHandlerParserCacheWriteRatio config

This was supposed to be removed before 1.40 was released.
We're now going onto 1.42.

Change-Id: I852060c8a41aa6cf21fb8e3da05c30a71dbbc453
This commit is contained in:
Paladox 2024-01-30 13:12:12 +00:00
parent 9fe3c9d1e8
commit 3df4952385
2 changed files with 0 additions and 25 deletions

View file

@ -645,19 +645,6 @@ abstract class ParsoidHandler extends Handler {
}
}
private function allowParserCacheWrite() {
$config = RequestContext::getMain()->getConfig();
// HACK: remove before the release of MW 1.40 / early 2023.
if ( $config->has( 'TemporaryParsoidHandlerParserCacheWriteRatio' ) ) {
// We need to be careful about ramping up the cache writes,
// so we don't run out of disk space.
return wfRandom() < $config->get( 'TemporaryParsoidHandlerParserCacheWriteRatio' );
}
return true;
}
/**
* Wikitext -> HTML helper.
* Spec'd in https://phabricator.wikimedia.org/T75955 and the API tests.
@ -715,13 +702,6 @@ abstract class ParsoidHandler extends Handler {
$pageConfig->getRevisionId() ?: null
);
if ( !$this->allowParserCacheWrite() ) {
// NOTE: In theory, we want to always write to the parser cache. However,
// the ParserCache takes a lot of disk space, and we need to have fine grained control
// over when we write to it, so we can avoid running out of disc space.
$helper->setUseParserCache( true, false );
}
$needsPageBundle = ( $format === ParsoidFormatHelper::FORMAT_PAGEBUNDLE );
if ( $attribs['body_only'] ) {

View file

@ -2120,11 +2120,6 @@ class ParsoidHandlerTest extends MediaWikiIntegrationTestCase {
// This should trigger a parser cache write, because we didn't set a write-ratio
$handler->wt2html( $pageConfig, $attribs );
$this->overrideConfigValue( 'TemporaryParsoidHandlerParserCacheWriteRatio', 0 );
// This should not trigger a parser cache write, because we set the write-ration to 0
$handler->wt2html( $pageConfig, $attribs );
}
public function testWt2html_BadContentModel() {