alpaca-proxy-agent
alpaca-proxy-agent copied to clipboard
Have to restart the service sometimes
It works well when I just started the service. I tried to run some jobs at the same time and they all can get data, but sometimes when I stopped those jobs, and later rerun them, there will be a long waiting time and no data. But if I restart the service before rerunning them, I can get the data immediately.
Another problem I got is when I run two jobs for more than 30 min, one job stopped as shown below. The other one is still running well.
2020-10-14 12:51:03,444 code = 1006 (connection closed abnormally [internal]), no reason Traceback (most recent call last): File "C:/Users/Administrator/PycharmProjects/alpaca-trading-bot/examples/try_wss.py", line 109, in <module> conn.run(['trade_updates', 'alpacadatav1/Q.GOOG', 'alpacadatav1/AM.TSLA']) File "D:\miniconda3\envs\alpaca-trading-bot\lib\site-packages\alpaca_trade_api\stream2.py", line 298, in run loop.run_until_complete(self.consume()) File "D:\miniconda3\envs\alpaca-trading-bot\lib\asyncio\base_events.py", line 616, in run_until_complete return future.result() asyncio.exceptions.CancelledError
Below is the log of the docker service
Hi, about the first issue, I need at least a log or a script to execute to reproduce it.
about the second issue, the client disconnects but doesn't re-connect. are you using the StreamConn object? it does the re-connection for you. here's a code example that does exactly that: https://github.com/alpacahq/alpaca-trade-api-python/blob/master/examples/websocket_example.py