Skip to content
This repository was archived by the owner on Jun 17, 2026. It is now read-only.

Commit e184c73

Browse files
committed
fixing _close
1 parent 0b4cae4 commit e184c73

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

alpaca_trade_api/stream.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -655,12 +655,10 @@ def run(self):
655655
pass
656656

657657
async def _close(self):
658-
await asyncio.gather(
659-
self.stop_ws(),
660-
self._trading_ws.close(),
661-
self._data_ws.close(),
662-
self._crypto_ws.close()
663-
)
658+
tasks = (task for task in
659+
(self.stop_ws(), self._trading_ws.close(), self._data_ws.close(), self._crypto_ws.close())
660+
)
661+
await asyncio.gather(*tasks)
664662

665663
def close(self):
666664
loop = asyncio.get_event_loop()

0 commit comments

Comments
 (0)