Skip to content

Commit b8b97b0

Browse files
Expand CONNECTING to the various ConnectingStates
1 parent 9b56362 commit b8b97b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/replit_river/v2/session.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,7 @@ async def _setup_heartbeat(
10761076

10771077
await asyncio.sleep(heartbeat_ms / 1000)
10781078
state = get_state()
1079-
if state == SessionState.CONNECTING:
1079+
if state in ConnectingStates:
10801080
logger.debug("Websocket is not connected, not sending heartbeat")
10811081
continue
10821082
try:
@@ -1132,7 +1132,7 @@ async def _serve(
11321132
while our_task and not our_task.cancelling() and not our_task.cancelled():
11331133
logging.debug(f"_serve loop count={idx}")
11341134
idx += 1
1135-
while (ws := get_ws()) is None or get_state() == SessionState.CONNECTING:
1135+
while (ws := get_ws()) is None or get_state() in ConnectingStates:
11361136
logging.debug("_handle_messages_from_ws spinning while connecting")
11371137
await block_until_connected()
11381138
logger.debug(

0 commit comments

Comments
 (0)