fix timeout error

This commit is contained in:
Jack Robison 2019-01-28 15:06:33 -05:00
parent a94cf04e87
commit bfaebf0085
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
3 changed files with 3 additions and 3 deletions

View file

@ -100,6 +100,6 @@ class AsyncGeneratorJunction:
pass pass
finally: finally:
if exc_type: if exc_type:
if exc_type not in (asyncio.CancelledError, asyncio.TimeoutError, StopAsyncIteration): if exc_type not in (asyncio.CancelledError, asyncio.TimeoutError, StopAsyncIteration, GeneratorExit):
err = traceback.format_exception(exc_type, exc, tb) err = traceback.format_exception(exc_type, exc, tb)
log.error(err) log.error(err)

View file

@ -218,7 +218,7 @@ class PingQueue:
await self._protocol.add_peer(p) await self._protocol.add_peer(p)
return return
await self._protocol.get_rpc_peer(p).ping() await self._protocol.get_rpc_peer(p).ping()
except TimeoutError: except asyncio.TimeoutError:
pass pass
while True: while True:

View file

@ -2815,7 +2815,7 @@ class Daemon(metaclass=JSONRPCServerType):
try: try:
result = await peer.ping() result = await peer.ping()
return result.decode() return result.decode()
except TimeoutError: except asyncio.TimeoutError:
return {'error': 'ping timeout'} return {'error': 'ping timeout'}
@requires(DHT_COMPONENT) @requires(DHT_COMPONENT)