forked from LBRYCommunity/lbry-sdk
fix timeout error
This commit is contained in:
parent
a94cf04e87
commit
bfaebf0085
3 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue