From 648d3afc21c9733cfbfec2c4e9a96e8400c536b3 Mon Sep 17 00:00:00 2001 From: Christoph Stahl Date: Fri, 23 May 2025 21:15:14 +0200 Subject: [PATCH] limit the autoconnect retries if the server is not available. --- syng/client.py | 2 +- typings/socketio/__init__.pyi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/syng/client.py b/syng/client.py index f53dd47..4bf61b4 100644 --- a/syng/client.py +++ b/syng/client.py @@ -160,7 +160,7 @@ class Client: self.connection_state = ConnectionState() self.set_log_level(config["config"]["log_level"]) - self.sio = socketio.AsyncClient(json=jsonencoder) + self.sio = socketio.AsyncClient(json=jsonencoder, reconnection_attempts=-1) self.loop: Optional[asyncio.AbstractEventLoop] = None self.skipped: list[UUID] = [] self.sources = configure_sources(config["sources"]) diff --git a/typings/socketio/__init__.pyi b/typings/socketio/__init__.pyi index cb26f36..f0d707f 100644 --- a/typings/socketio/__init__.pyi +++ b/typings/socketio/__init__.pyi @@ -36,7 +36,7 @@ class AsyncServer: def instrument(self, auth: dict[str, str]) -> None: ... class AsyncClient: - def __init__(self, json: Any = None): ... + def __init__(self, json: Any = None, reconnection_attempts: int = 0): ... def on( self, event: str, handler: Optional[Callable[..., Any]] = None ) -> Callable[[ClientHandler], ClientHandler]: ...