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

1 Like

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.