Skip to content

Commit ea1daed

Browse files
committed
refactor: Simplify async get_status with or-fallback
1 parent 82c10ea commit ea1daed

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

ldclient/impl/async_big_segments.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,7 @@ def get_status(self) -> BigSegmentStoreStatus:
7777
inline; the async variant (whose status getter cannot await) reports
7878
the store as unavailable until the polling task has run.
7979
"""
80-
status = self.__last_status
81-
if status is None:
82-
return BigSegmentStoreStatus(False, False)
83-
return status
80+
return self.__last_status or BigSegmentStoreStatus(False, False)
8481

8582
async def poll_store_and_update_status(self) -> BigSegmentStoreStatus:
8683
new_status = BigSegmentStoreStatus(False, False) # default to "unavailable" if we don't get a new status below

0 commit comments

Comments
 (0)