From db895a365cbb3a94a1bc23cec4b5d50b6b6a3091 Mon Sep 17 00:00:00 2001 From: Luhan Salimena Date: Thu, 5 Oct 2023 10:48:13 -0300 Subject: [PATCH] fix: only save failover if config is active --- src/Unleash.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Unleash.php b/src/Unleash.php index d4ca2f6..43b3340 100644 --- a/src/Unleash.php +++ b/src/Unleash.php @@ -37,8 +37,9 @@ public function getFeatures(): array try { $features = $this->getCachedFeatures(); - // Always store the failover cache, in case it is turned on during failure scenarios. - $this->cache->forever('unleash.features.failover', $features); + if ($this->config->get('unleash.cache.failover') === true) { + $this->cache->forever('unleash.features.failover', $features); + } return $features; } catch (TransferException | JsonException $e) {