Skip to content

Commit 45b6c72

Browse files
committed
Reconnection triggering fixed.
1 parent fc031e8 commit 45b6c72

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

async_substrate_interface/async_substrate.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,10 @@ async def _handler(self, ws: ClientConnection) -> Union[None, Exception]:
747747
task_res = task.result()
748748

749749
# If ConnectionClosedOK, graceful shutdown - don't reconnect
750-
if isinstance(task_res, websockets.exceptions.ConnectionClosedOK):
750+
if (
751+
isinstance(task_res, websockets.exceptions.ConnectionClosedOK)
752+
and self._waiting_for_response <= 0
753+
):
751754
logger.debug("Graceful shutdown detected, not reconnecting")
752755
return None # Clean exit
753756

0 commit comments

Comments
 (0)