]> source.dussan.org Git - nextcloud-server.git/commitdiff
returns non lazy value while searching for lazy 43247/head
authorMaxence Lange <maxence@artificial-owl.com>
Wed, 31 Jan 2024 23:03:27 +0000 (22:03 -0100)
committerMaxence Lange <maxence@artificial-owl.com>
Tue, 6 Feb 2024 01:00:58 +0000 (00:00 -0100)
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
lib/private/AppConfig.php

index 07eebf1d047d6864fbfc6d606d0a1b4f1d089db7..60b0e77f7af9f3d84534ff606987ca6cb36b283e 100644 (file)
@@ -462,11 +462,14 @@ class AppConfig implements IAppConfig {
                        throw new AppConfigTypeConflictException('conflict with value type from database');
                }
 
-               if ($lazy) {
-                       return $this->lazyCache[$app][$key] ?? $default;
-               }
-
-               return $this->fastCache[$app][$key] ?? $default;
+               /**
+                * - the pair $app/$key cannot exist in both array,
+                * - we should still returns an existing non-lazy value even if current method
+                *   is called with $lazy is true
+                *
+                * This way, lazyCache will be empty until the load for lazy config value is requested.
+                */
+               return $this->lazyCache[$app][$key] ?? $this->fastCache[$app][$key] ?? $default;
        }
 
        /**