Closed foentiex closed 2 years ago
Hello!
Do you get this error everytime you start it or just sometimes?
I can provide a fix to handle this error and reinit the cache.
Hello. Today it has been three times that has given the error. Now it takes an hour without failure
Ok, i will post an update asap. I think next week
In the meantime you could build a try-except block arround the depthcache command and excpet TypeError
and just restart the manager
Ok, thank you
2.0.0 has been released https://pypi.org/project/unicorn-binance-local-depth-cache/
Version of this library.
0.7.2
Solution to Issue cannot be found in the documentation or other Issues and also occurs in the latest version of this library.
Hardware?
Local server/workstation
Operating System?
Linux
Python version?
Python3.9
Installed packages
Logging output
Used endpoint?
binance.com-futures
Issue
Hello. Testing the library with this code:
-------------------------------------------------------
future_client = BinanceRestApiManager(exchange="binance.com-futures", api_key=api_key, api_secret=api_secret)
bw_api_manager = BinanceWebSocketApiManager(exchange="binance.com-futures", high_performance=True, enable_stream_signal_buffer=True) ubldc = BinanceLocalDepthCacheManager(exchange="binance.com-futures", ubwa_manager=bw_api_manager) markets = ['BNBBUSD', 'ETHBUSD', 'GMTBUSD', 'XRPBUSD', 'SOLBUSD', 'ADABUSD', 'DOGEBUSD'] ubldc.create_depth_cache(markets=markets, refresh_interval=5)
while True: stream_data = bw_api_manager.pop_stream_data_from_stream_buffer() kline = json.loads(stream_data) symbol = kline['data']['s']
--------------
Before an hour the next error is showing:
BinanceLocalDepthCacheManager._init_depth_cache() - Can not download order_book snapshot for the depth_cache with market ethbusd - requests.exceptions.ReadTimeout - error_msg: HTTPSConnectionPool(host='fapi.binance.com', port=443): Read timed out. (read timeout=10) Exception in thread Thread-5: Traceback (most recent call last): File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 910, in run self._target(*self._args, **self._kwargs) File "/home/workspace/crypto/futuress/venv/lib/python3.9/site-packages/unicorn_binance_local_depth_cache/manager.py", line 372, in _process_stream_data if not self._init_depth_cache(market=market): File "/home/workspace/crypto/futures/venv/lib/python3.9/site-packages/unicorn_binance_local_depth_cache/manager.py", line 326, in _init_depth_cache self.depth_caches[market]['last_update_id'] = int(order_book['lastUpdateId']) TypeError: 'NoneType' object is not subscriptable