Give some breath to the websocket ping loop

This commit is contained in:
Fabio Manganiello 2018-01-29 21:21:40 +01:00
parent 07219bef89
commit fc608317fd
1 changed files with 1 additions and 0 deletions

View File

@ -123,6 +123,7 @@ class HttpBackend(Backend):
try:
waiter = await websocket.ping()
await asyncio.wait_for(waiter, timeout=5)
time.sleep(0.1)
except (asyncio.TimeoutError, websockets.exceptions.ConnectionClosed) as e:
logging.info('Client {} closed connection'.format(websocket.remote_address[0]))
self.active_websockets.remove(websocket)