Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.

Set to only save failover if config is active #48

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Unleash.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down