File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -1086,13 +1086,12 @@ async def _do_ensure_connected[HandshakeMetadata](
10861086 last_error : Exception | None = None
10871087 attempt_count = 0
10881088
1089- handshake_deadline_ms = (
1089+ handshake_deadline = (
10901090 get_current_time () + transport_options .handshake_timeout_ms / 1000
10911091 )
10921092
10931093 while (
1094- rate_limiter .has_budget (client_id )
1095- and get_current_time () < handshake_deadline_ms
1094+ rate_limiter .has_budget (client_id ) and get_current_time () < handshake_deadline
10961095 ):
10971096 if (state := get_state ()) in TerminalStates or state in ActiveStates :
10981097 logger .info (f"_do_ensure_connected stopping due to state={ state } " )
@@ -1154,14 +1153,14 @@ async def websocket_closed_callback() -> None:
11541153 "Handshake failed, conn closed while sending response" ,
11551154 ) from e
11561155
1157- if get_current_time () >= handshake_deadline_ms :
1156+ if get_current_time () >= handshake_deadline :
11581157 raise RiverException (
11591158 ERROR_HANDSHAKE ,
11601159 "Handshake response timeout, closing connection" ,
11611160 )
11621161
11631162 try :
1164- timeout = handshake_deadline_ms - get_current_time () / 1000.0
1163+ timeout = handshake_deadline - get_current_time ()
11651164 async with asyncio .timeout (timeout ):
11661165 data = await ws .recv (decode = False )
11671166 except ConnectionClosedOK :
You can’t perform that action at this time.
0 commit comments