Skip to content

Commit cc0ec5c

Browse files
committed
don't fall back by default
1 parent f443634 commit cc0ec5c

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

posthog/client.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,18 +1419,14 @@ def _initialize_flag_cache(self, cache_url):
14191419

14201420
except ImportError:
14211421
self.log.warning(
1422-
"[FEATURE FLAGS] Redis not available, falling back to memory cache"
1422+
"[FEATURE FLAGS] Redis not available, flag caching disabled"
14231423
)
1424-
# Fallback to memory cache with same TTL
1425-
size = int(query_params.get("size", [10000])[0])
1426-
return FlagCache(size, ttl)
1424+
return None
14271425
except Exception as e:
14281426
self.log.warning(
1429-
f"[FEATURE FLAGS] Redis connection failed: {e}, falling back to memory cache"
1427+
f"[FEATURE FLAGS] Redis connection failed: {e}, flag caching disabled"
14301428
)
1431-
# Fallback to memory cache with same TTL
1432-
size = int(query_params.get("size", [10000])[0])
1433-
return FlagCache(size, ttl)
1429+
return None
14341430
else:
14351431
raise ValueError(
14361432
f"Unknown cache URL scheme: {scheme}. Supported schemes: memory, redis"

0 commit comments

Comments
 (0)