Skip to content

Commit e428549

Browse files
committed
refactor: Use EMPTY_MEMBERSHIP module constant directly
Drop the redundant EMPTY_MEMBERSHIP class attribute and reference the big_segments_common module constant directly instead of via self.
1 parent eb1c4d1 commit e428549

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

ldclient/impl/async_big_segments.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919

2020

2121
class AsyncBigSegmentStoreManager:
22-
EMPTY_MEMBERSHIP = EMPTY_MEMBERSHIP
23-
2422
"""
2523
Internal component that decorates the Big Segment store with caching behavior, and also polls the
2624
store to track its status. The constructor starts the polling task.
@@ -59,7 +57,7 @@ async def get_user_membership(self, user_key: str) -> Tuple[Optional[dict], str]
5957
try:
6058
membership = await self.__store.get_membership(user_hash) # type: ignore[misc]
6159
if membership is None:
62-
membership = self.EMPTY_MEMBERSHIP
60+
membership = EMPTY_MEMBERSHIP
6361
self.__cache[user_key] = membership
6462
except Exception as e:
6563
log.exception("Big Segment store membership query returned error: %s" % e)

ldclient/impl/big_segments.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919

2020

2121
class BigSegmentStoreManager:
22-
EMPTY_MEMBERSHIP = EMPTY_MEMBERSHIP
23-
2422
"""
2523
Internal component that decorates the Big Segment store with caching behavior, and also polls the
2624
store to track its status.
@@ -58,7 +56,7 @@ def get_user_membership(self, user_key: str) -> Tuple[Optional[dict], str]:
5856
try:
5957
membership = self.__store.get_membership(user_hash)
6058
if membership is None:
61-
membership = self.EMPTY_MEMBERSHIP
59+
membership = EMPTY_MEMBERSHIP
6260
self.__cache[user_key] = membership
6361
except Exception as e:
6462
log.exception("Big Segment store membership query returned error: %s" % e)

0 commit comments

Comments
 (0)