Browse Source

jsonrpc: pass timeout to aiohttp session

master
ThomasV 5 years ago
parent
commit
085b6ca2ab
  1. 2
      electrum/daemon.py

2
electrum/daemon.py

@ -107,7 +107,7 @@ def request(config: SimpleConfig, endpoint, args=(), timeout=60):
loop = asyncio.get_event_loop() loop = asyncio.get_event_loop()
async def request_coroutine(): async def request_coroutine():
async with aiohttp.ClientSession(auth=auth) as session: async with aiohttp.ClientSession(auth=auth) as session:
server = AiohttpClient(session, server_url) server = AiohttpClient(session, server_url, timeout=timeout)
f = getattr(server, endpoint) f = getattr(server, endpoint)
response = await f(*args) response = await f(*args)
return response.data.result return response.data.result

Loading…
Cancel
Save