Problems with stream disconnects shortly after 6pm

Dear Alpaca devs,

I have a few hundred orders that expire at 6pm every day. Automated cancellations start to flow in via websockets but the connection invariably breaks shortly (a min or two) thereafter, leaving my local database and alpaca’s server in an inconsistent state. Because of that, each day I need to sync the databases through REST calls, which is needlessly expensive. This has been happening for the last couple of months but /not/ before. Now this is a daily occurrence. Is there anything you can possibly do to alleviate this? Websockets always close with:

WARNING: code = 1006 (connection closed abnormally [internal]), no reason

The API reconnects, but again, the problem is that my local database is left in an async state.

Thanks,
Andrej

2 Likes

Thanks for the report. We are not aware of such behavior change in the websocket, but we will take a look. To our best knowledge, there shouldn’t be such disconnection for the particular time of the day (of course, it is expected the connection can be disconnected due to network in the middle, etc). We will keep you posted.

Hello @hitoshi - I am having this issue after receiving a Connected message. wscat shows that is connect and after inputting my authentication details, i get this disconnected message. Even if i dont put my authentication, i still get disconnected. Any help on this is greatly appreciated.