ccxt-websockets-db-updater
ccxt-websockets-db-updater copied to clipboard
Fix ob_updater subscribe_ws error handling
In ob_updater
, subscribe_ws
I removed these lines and added a TODO to this issue.
error_message = type(err).__name__ + ":" + str(err)
logging.error(f'{exchange.id}: {error_message}')
logging.error(error_stack)
The problem is that the error is not logged. Try to run binance and cexio at the same time to get some errors.
Also, I removed these lines:
await exchange.close()
raise WsError(exchange.id)
This was causing binance websockets to stop. My idea was to close the channel with the problematic exchange/pair, not shut down ALL channels from one exchange.
Ideally I'd like to re-subscribe the websocket that is causing errors (or that got disconnected).
To reproduce:
settings.ini
[config]
db_url: postgres://dbusr:dbpwd@localhost:5432/cryptows
order_book_entries_limit: 1
[binance]
symbols: BTC/USDT
EOS/USDT
ETH/USDT
[cex]
symbols: BTC/USD
BTC/EUR
Run:
./ob_updater.py --reset_db
Error I get:
subscribed: cex BTC/USD
subscribed: cex BTC/EUR
subscribed: binance BTC/USDT
binance, 2019-01-17 23:27:57.255584, [<FrameSummary file /home/paul/projects-python/ccxtws/ob_updater.py, line 142 in
Sorry @firepol I don't have a cex account to test, I have reported to cex support, but still doesn't work ( I don't receive any confirmation email from CEX). It's weird that you get this issue only in combination with cex. Maybe something wrong in cex implementaion, I couldn't check it out recently.