interface: if request times out, no need to dump trace
This commit is contained in:
@@ -72,9 +72,12 @@ class NotificationSession(ClientSession):
|
|||||||
timeout = 20 if not self.proxy else 30
|
timeout = 20 if not self.proxy else 30
|
||||||
# note: the semaphore implementation guarantees no starvation
|
# note: the semaphore implementation guarantees no starvation
|
||||||
async with self.in_flight_requests_semaphore:
|
async with self.in_flight_requests_semaphore:
|
||||||
return await asyncio.wait_for(
|
try:
|
||||||
super().send_request(*args, **kwargs),
|
return await asyncio.wait_for(
|
||||||
timeout)
|
super().send_request(*args, **kwargs),
|
||||||
|
timeout)
|
||||||
|
except asyncio.TimeoutError as e:
|
||||||
|
raise GracefulDisconnect('request timed out: {}'.format(args)) from e
|
||||||
|
|
||||||
async def subscribe(self, method, params, queue):
|
async def subscribe(self, method, params, queue):
|
||||||
# note: until the cache is written for the first time,
|
# note: until the cache is written for the first time,
|
||||||
|
|||||||
Reference in New Issue
Block a user