Skip to content

Commit 4a0d14b

Browse files
committed
fix: Route FeatureStoreClientWrapper.disable_cache through __wrapper
Uniform with the other methods on the class. The inner call is wrapped in try/except so the operation cannot leak an exception into the availability-tracking path.
1 parent 837140e commit 4a0d14b

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

ldclient/impl/datasystem/fdv2.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,15 @@ def initialized(self) -> bool:
153153
return self.store.initialized
154154

155155
def disable_cache(self) -> None:
156-
# In-process state change; intentionally bypasses __wrapper so a
157-
# successful disable doesn't flap the data store's availability state.
158-
inner = self.store
159-
if hasattr(inner, "disable_cache"):
160-
inner.disable_cache() # type: ignore[attr-defined]
156+
def _do_disable():
157+
try:
158+
inner = self.store
159+
if hasattr(inner, "disable_cache"):
160+
inner.disable_cache() # type: ignore[attr-defined]
161+
except Exception as e:
162+
log.warning("disable_cache failed on inner store: %s", e)
163+
164+
self.__wrapper(_do_disable)
161165

162166
def __wrapper(self, fn: Callable):
163167
try:

0 commit comments

Comments
 (0)