Skip to content

Commit

Permalink
Cache false when config value not found
Browse files Browse the repository at this point in the history
  • Loading branch information
Jade-GG committed Feb 24, 2025
1 parent bcda259 commit 65f3baf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Models/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ public static function getValue(
// Catch the case it is intentionally set to null
if (Arr::has($configCache, $cacheKey)) {
$result = Arr::get($configCache, $cacheKey);
if ($result === false) {
$result = $options['default'] ?? null;
}

return (bool) $options['decrypt'] && is_string($result) ? static::decrypt($result) : $result;
}
Expand All @@ -118,7 +121,7 @@ public static function getValue(
$result = $resultObject ? $resultObject->value : ($options['default'] ?? null);

if ($options['cache'] ?? true) {
Arr::set($configCache, $cacheKey, $result);
Arr::set($configCache, $cacheKey, $resultObject ? $result : false);
Cache::driver('rapidez:multi')->set('magento.config', $configCache);
}

Expand Down

0 comments on commit 65f3baf

Please sign in to comment.