Closed foentiex closed 2 years ago
The same bug occurs in the version 0.2.0
Traceback (most recent call last):
File "/test/unicorn/example_depthcache.py", line 26, in
Thanks for reporting it.
I added threading locks to avoid concurrent access to asks and bids which changes in a very high frequency.
Check this or we will delete your issue. (fill in the checkbox with an X like so: [x])
Select one:
Environment
What kind of internet connection do you have?
Average system load (CPU)
Hardware specification
Operating System? (include version)
Which endpoint do you connect?
Python Version Requirement
Exact Python Version?
Pip Version?
Dependencies
Run
pip list > pip_list.txt
and upload the file. pip_list.txtUNICORN Binance Local Depth Cache Version?
Description of your issue
Running the next file:
example_depthcache_2.py.txt
Traceback (most recent call last): File "/test/unicorn/example_depthcache.py", line 61, in
print(market + f" Top 10 asks: {ubldc.get_asks(market=market)[:10]}")
File "venv2/lib/python3.8/site-packages/unicorn_binance_local_depth_cache/manager.py", line 399, in get_asks
return self._sort_depth_cache(self.depth_caches[market.lower()]['asks'], reverse=False)
File "/venv2/lib/python3.8/site-packages/unicorn_binance_local_depth_cache/manager.py", line 321, in _sort_depth_cache
new_items = [[float(price), float(quantity)] for price, quantity in items.items()]
File /venv2/lib/python3.8/site-packages/unicorn_binance_local_depth_cache/manager.py", line 321, in
new_items = [[float(price), float(quantity)] for price, quantity in items.items()]
RuntimeError: dictionary changed size during iteration