Skip to content

Commit 0c6e356

Browse files
authored
Merge pull request #7 from tm1000/patch-1
Check cache for useCacheAsFailover
2 parents 8d11adf + 5724796 commit 0c6e356

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Flagsmith.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,10 @@ private function cachedCall(
489489
$response = $this->call($method, $uri, $body);
490490
$this->cache->set($cacheKey, $response);
491491
} catch (APIException $e) {
492-
if (!$this->useCacheAsFailover) {
492+
if (
493+
!$this->useCacheAsFailover ||
494+
!$this->cache->has($cacheKey)
495+
) {
493496
throw $e;
494497
}
495498
}

0 commit comments

Comments
 (0)