Skip to content

Commit bff6a1a

Browse files
committed
Fin.
1 parent 415c66a commit bff6a1a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

async_substrate_interface/async_substrate.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -633,9 +633,9 @@ async def _handler(self, ws: ClientConnection) -> None:
633633
should_reconnect = False
634634
for task in pending:
635635
task.cancel()
636-
if isinstance(recv_task.result(), asyncio.TimeoutError):
637-
# TODO check the logic here
638-
should_reconnect = True
636+
for task in done:
637+
if isinstance(task.result(), (asyncio.TimeoutError, ConnectionClosed)):
638+
should_reconnect = True
639639
if should_reconnect is True:
640640
for original_id, payload in list(self._inflight.items()):
641641
self._received[original_id] = loop.create_future()
@@ -796,6 +796,7 @@ async def retrieve(self, item_id: str) -> Optional[dict]:
796796
if item.done():
797797
self.max_subscriptions.release()
798798
del self._received[item_id]
799+
799800
return item.result()
800801
else:
801802
try:

0 commit comments

Comments
 (0)