Skip to content

Commit 8443713

Browse files
committed
Prevent race condition
1 parent 7154fef commit 8443713

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

async_substrate_interface/async_substrate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2512,6 +2512,7 @@ async def _make_rpc_request(
25122512
subscription_added = False
25132513

25142514
async with self.ws as ws:
2515+
await ws.mark_waiting_for_response()
25152516
for payload in payloads:
25162517
item_id = await ws.send(payload["payload"])
25172518
request_manager.add_request(item_id, payload["id"])
@@ -2523,7 +2524,6 @@ async def _make_rpc_request(
25232524
logger.debug(
25242525
f"Submitted payload ID {payload['id']} with websocket ID {item_id}: {output_payload}"
25252526
)
2526-
await ws.mark_waiting_for_response()
25272527

25282528
while True:
25292529
for item_id in request_manager.unresponded():

0 commit comments

Comments
 (0)