We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9010fbb commit f616783Copy full SHA for f616783
1 file changed
src/replit_river/v2/session.py
@@ -1090,11 +1090,17 @@ async def _do_ensure_connected[HandshakeMetadata](
1090
get_current_time() + transport_options.handshake_timeout_ms / 1000
1091
)
1092
1093
- while rate_limiter.has_budget(client_id):
+ while (
1094
+ rate_limiter.has_budget(client_id)
1095
+ and get_current_time() < handshake_deadline_ms
1096
+ ):
1097
if (state := get_state()) in TerminalStates or state in ActiveStates:
1098
logger.info(f"_do_ensure_connected stopping due to state={state}")
1099
break
1100
1101
+ if (task := asyncio.current_task()) and task.cancelled():
1102
+ break
1103
+
1104
if attempt_count > 0:
1105
logger.info(f"Retrying build handshake number {attempt_count} times")
1106
attempt_count += 1
0 commit comments