From ea4d6422e3e8f36f8b17d33c84393cf72ee06278 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 23 Mar 2022 11:38:31 +0100 Subject: [PATCH] SettingsBuilder: add comments about batched caching. One reason to have batching in SettingsBuilder is so we can cache an entire batch of settings after merging them, rather than caching each file individually. However, this has not been implemented, and it's not entirely clear if it's a good idea. This patch adds comments to SettingsBuilder that point to the relevant ticket, for reference and consideration when working on SettingsBuilder in the future. Bug: T304493 Change-Id: I1fb7b7e4a97e6d0788c9b1732a1718f3c8b365d5 --- includes/Settings/SettingsBuilder.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/Settings/SettingsBuilder.php b/includes/Settings/SettingsBuilder.php index 53435446cd9..ca19f2f42ea 100644 --- a/includes/Settings/SettingsBuilder.php +++ b/includes/Settings/SettingsBuilder.php @@ -106,6 +106,7 @@ class SettingsBuilder { public function load( SettingsSource $source ): self { $this->assertNotFinished(); + // XXX: We may want to cache the entire batch instead, see T304493. $this->currentBatch[] = $this->wrapSource( $source ); return $this; @@ -204,6 +205,8 @@ class SettingsBuilder { $this->assertNotFinished(); $this->config = null; + // XXX: We may want to cache the entire batch after merging together + // settings from all sources, see T304493. $allSettings = $this->loadRecursive( $this->currentBatch ); foreach ( $allSettings as $settings ) {