From fc608317fdae2c6701b5a2f9e2150299ffce25ee Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 29 Jan 2018 21:21:40 +0100 Subject: [PATCH] Give some breath to the websocket ping loop --- platypush/backend/http/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/platypush/backend/http/__init__.py b/platypush/backend/http/__init__.py index 4093703c47..b9b37b72ec 100644 --- a/platypush/backend/http/__init__.py +++ b/platypush/backend/http/__init__.py @@ -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)