From 3fda559d887a99b79676e7e627e401dd2c9a49c2 Mon Sep 17 00:00:00 2001 From: Lev Gorodetskiy Date: Wed, 21 Apr 2021 09:07:45 +0300 Subject: [PATCH] Patch aiorignalrcore to avoid reconnections --- src/dipdup/__init__.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/dipdup/__init__.py b/src/dipdup/__init__.py index b794fd409..836b8014a 100644 --- a/src/dipdup/__init__.py +++ b/src/dipdup/__init__.py @@ -1 +1,15 @@ +import asyncio + +from aiosignalrcore.transport.websockets.reconnection import ConnectionStateChecker # type: ignore + __version__ = '0.1.0' + + +async def run(self): + while self.running: + await asyncio.sleep(self.keep_alive_interval) + await self.ping_function() + + +# FIXME: https://github.com/mandrewcito/signalrcore/pull/58 +ConnectionStateChecker.run = run