Skip to content

Commit d5412c6

Browse files
committed
chore: socketio 断开之后没有重新连接的问题
1 parent e8947a6 commit d5412c6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/cluster.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ def __init__(
157157
self.sio = socketio.AsyncClient(
158158
handle_sigint=False,
159159
reconnection_attempts=10,
160+
reconnection_delay=10,
161+
reconnection_delay_max=100,
160162
logger=DEBUG,
161163
engineio_logger=DEBUG,
162164
)
@@ -225,6 +227,9 @@ async def _():
225227
logger.tinfo("cluster.disconnected", id=self.id, name=self.display_name)
226228
await self.disable()
227229

230+
await anyio.sleep(600)
231+
await self.connect()
232+
228233
@self.sio.on("reconnect") # type: ignore
229234
async def _(attempt: int):
230235
logger.tinfo("cluster.reconnect", id=self.id, name=self.display_name, attempt=attempt)

0 commit comments

Comments
 (0)