From 60eca80b7b1940a330613cd8c8c30880c69b6eeb Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Wed, 7 Aug 2024 17:45:58 +0100 Subject: 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 --- includes/Storage/PageEditStash.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'includes/Storage') 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; -- cgit v1.2.3