Skip to content

Commit 48463ad

Browse files
authored
Increase ping timeout (#591)
1 parent 14d6c9c commit 48463ad

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

alpaca_trade_api/stream.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ def __init__(self,
6464
async def _connect(self):
6565
self._ws = await websockets.connect(
6666
self._endpoint,
67-
extra_headers={'Content-Type': 'application/msgpack'})
67+
extra_headers={'Content-Type': 'application/msgpack'},
68+
ping_interval=10,
69+
ping_timeout=180,
70+
max_queue=1024,
71+
)
6872
r = await self._ws.recv()
6973
msg = msgpack.unpackb(r)
7074
if msg[0]['T'] != 'success' or msg[0]['msg'] != 'connected':

0 commit comments

Comments
 (0)