From 1663d4ac9373dee51d9512364c340ff22186fff4 Mon Sep 17 00:00:00 2001 From: Arseny <36441601+arkuzo@users.noreply.github.com> Date: Tue, 19 Nov 2024 15:14:01 +0300 Subject: [PATCH] fix Client::wait unexpected return after success reconnect --- src/socketio/client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/socketio/client.py b/src/socketio/client.py index d7af407..68bcdda 100644 --- a/src/socketio/client.py +++ b/src/socketio/client.py @@ -179,6 +179,8 @@ class Client(base_client.BaseClient): while True: self.eio.wait() self.sleep(1) # give the reconnect task time to start up + if self.eio.state != 'connected': # reconnect task finished while `self.sleep(1)` was executing + continue if not self._reconnect_task: break self._reconnect_task.join()