Skip to content

Commit 6a5ca9c

Browse files
committed
fix: Default AsyncConfig feature store to AsyncInMemoryFeatureStore
Match sync Config, which always defaults to an in-memory store when none is provided, so callers and the async client can rely on a non-null feature store.
1 parent 42d17c8 commit 6a5ca9c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

ldclient/async_config.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
from typing import Callable, List, Optional, Set
1212

13+
from ldclient.async_feature_store import AsyncInMemoryFeatureStore
1314
from ldclient.config import (
1415
DEFAULT_BASE_URI,
1516
DEFAULT_EVENTS_URI,
@@ -220,7 +221,7 @@ def __init__(
220221
self.__initial_reconnect_delay = initial_reconnect_delay
221222
self.__poll_interval = max(poll_interval, 30.0)
222223
self.__use_ldd = use_ldd
223-
self.__feature_store = feature_store
224+
self.__feature_store = AsyncInMemoryFeatureStore() if not feature_store else feature_store
224225
self.__event_processor_class = event_processor_class
225226
self.__feature_requester_class = feature_requester_class
226227
self.__events_max_pending = events_max_pending
@@ -308,7 +309,7 @@ def use_ldd(self) -> bool:
308309
return self.__use_ldd
309310

310311
@property
311-
def feature_store(self) -> Optional[AsyncFeatureStore]:
312+
def feature_store(self) -> AsyncFeatureStore:
312313
return self.__feature_store
313314

314315
@property

0 commit comments

Comments
 (0)