crypto-power/cryptopower

fetch exchange rate api should pick a working default

Closed this issue · 1 comments

on first startup , binance is the chosen default for the fetch exchange rate api, and if it's not available after three tries, then no exchange rate is selected.

It seems to be a better option for the fetch exchange rate function to try each available exchange api in an attempt to get a working api, and only when it's not able to find a working, it then defaults to none.

2024-06-24 08:45:26.414 [ERR] EXT: fetching ticker 1 failed: binance failed to fetch ticker for BTC-USDT: Get "https://api.binance.com/api/v3/ticker/24hr?symbol=BTCUSDT": dial tcp: lookup api.binance.com on 127.0.0.*: no such host. Retrying in 1s

2024-06-24 08:45:27.423 [ERR] EXT: fetching ticker 2 failed: binance failed to fetch ticker for BTC-USDT: Get "https://api.binance.com/api/v3/ticker/24hr?symbol=BTCUSDT": dial tcp: lookup api.binance.com on 127.0.0.*: no such host. Retrying in 2s

2024-06-24 08:45:29.437 [ERR] EXT: fetching ticker 3 failed: binance failed to fetch ticker for BTC-USDT: Get "https://api.binance.com/api/v3/ticker/24hr?symbol=BTCUSDT": dial tcp: lookup api.binance.com on 127.0.0.*: no such host. Retrying in 4s

2024-06-24 08:45:33.446 [ERR] EXT: binance: Error fetching ticker: binance failed to fetch ticker for BTC-USDT: Get "https://api.binance.com/api/v3/ticker/24hr?symbol=BTCUSDT": dial tcp: lookup api.binance.com on 127.0.0.*: no such host

I am working on it