Deleted unused timeout logic

dark_clearing_improvements
Esmeralda Gallardo 2022-12-19 14:55:06 -03:00
parent a6e921548b
commit 18e4352faf
No known key found for this signature in database
GPG Key ID: AD67FBB417CAC71B
1 changed files with 28 additions and 38 deletions

View File

@ -178,9 +178,6 @@ async def open_jsonrpc_session(
request_type: Optional[type] = None, request_type: Optional[type] = None,
request_hook: Optional[Callable] = None, request_hook: Optional[Callable] = None,
error_hook: Optional[Callable] = None, error_hook: Optional[Callable] = None,
timeout: int = 5,
timeout_hook: Optional[Callable] = None,
timeout_args: list = [],
) -> Callable[[str, dict], dict]: ) -> Callable[[str, dict], dict]:
async with ( async with (
@ -226,9 +223,8 @@ async def open_jsonrpc_session(
receives every ws message and stores it in its corresponding result receives every ws message and stores it in its corresponding result
field, then sets the event to wakeup original sender tasks. field, then sets the event to wakeup original sender tasks.
also recieves responses to requests originated from the server side. also recieves responses to requests originated from the server side.
reconnects the tasks after timeout.
''' '''
with trio.move_on_after(timeout) as cancel_scope:
async for msg in ws: async for msg in ws:
match msg: match msg:
case { case {
@ -263,12 +259,6 @@ async def open_jsonrpc_session(
case _: case _:
log.warning(f'Unhandled JSON-RPC msg!?\n{msg}') log.warning(f'Unhandled JSON-RPC msg!?\n{msg}')
if cancel_scope.cancelled_caught:
await ws._connect()
n.start_soon(recv_task)
if timeout_hook:
n.start_soon(timeout_hook, json_rpc, *timeout_args)
n.start_soon(recv_task) n.start_soon(recv_task)
yield json_rpc yield json_rpc