aboutsummaryrefslogtreecommitdiffstats
path: root/includes/Storage/PageEditStash.php
diff options
context:
space:
mode:
authorTimo Tijhof <krinkle@fastmail.com>2024-08-07 17:45:58 +0100
committerTimo Tijhof <krinkle@fastmail.com>2024-08-09 22:45:04 +0100
commit60eca80b7b1940a330613cd8c8c30880c69b6eeb (patch)
treefa7e9fd72cadb4f20e810736c9419f3eba98c20d /includes/Storage/PageEditStash.php
parent3804015b7fd5b483cb60890c6522e2311545a72f (diff)
downloadmediawikicore-60eca80b7b1940a330613cd8c8c30880c69b6eeb.tar.gz
mediawikicore-60eca80b7b1940a330613cd8c8c30880c69b6eeb.zip
objectcache: Consolidate WRITE_PRUNE_SEGMENTS into WRITE_ALLOW_SEGMENTS
Instead of making the caller responsible for knowing what we do internally at each step, rebrand WRITE_ALLOW_SEGMENTS as generally "do stuff for segments", not only creating them, but also deleting them. * Easier to find and verify correct usage. * Easier to understand parity between set() and delete(). * Documentation for deleteMulti() already said this, by mistake. * Reduce amount of required knowledge. There is only 1 usage in Codesearch Everywhere (in PageEditStash here in core), with no known usage anywhere else. Hypothetically, if it were used, this commit keeps compat by aliasing WRITE_PRUNE_SEGMENTS to WRITE_ALLOW_SEGMENTS. Change-Id: Iea10b23f06243814c35ccd02a4a878cdc1195c76
Diffstat (limited to 'includes/Storage/PageEditStash.php')
-rw-r--r--includes/Storage/PageEditStash.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/includes/Storage/PageEditStash.php b/includes/Storage/PageEditStash.php
index c2beb3782efc..c9303d26c382 100644
--- a/includes/Storage/PageEditStash.php
+++ b/includes/Storage/PageEditStash.php
@@ -541,7 +541,7 @@ class PageEditStash {
$keyList = $this->cache->get( $key ) ?: [];
if ( count( $keyList ) >= self::MAX_CACHE_RECENT ) {
$oldestKey = array_shift( $keyList );
- $this->cache->delete( $oldestKey, BagOStuff::WRITE_PRUNE_SEGMENTS );
+ $this->cache->delete( $oldestKey, BagOStuff::WRITE_ALLOW_SEGMENTS );
}
$keyList[] = $newKey;