Skip to content

Commit

Permalink
Tweak fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
M1K8 committed Feb 14, 2022
1 parent 3f94dbd commit aad751c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/fetcher/fetch_quotes.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ func getCryptoBackup(coin, resolution string, from, to time.Time) (*finnhub.Cryp
cfg.AddDefaultHeader("X-Finnhub-Token", finn)
finnhubClient := finnhub.NewAPIClient(cfg).DefaultApi

candles, req, err := finnhubClient.CryptoCandles(context.Background()).Symbol("BINANCE:" + strings.ToUpper(coin) + "USD").Resolution(resolution).From(from.Unix()).To(to.Unix()).Execute()
candles, req, err := finnhubClient.CryptoCandles(context.Background()).Symbol("BINANCE:" + strings.ToUpper(coin) + "USDT").Resolution(resolution).From(from.Unix()).To(to.Unix()).Execute()

if err != nil {
if req != nil {
log.Println(req.StatusCode)
candles, req, err := finnhubClient.CryptoCandles(context.Background()).Symbol("BINANCE:" + strings.ToUpper(coin) + "USDT").Resolution(resolution).From(from.Unix()).To(to.Unix()).Execute()
candles, req, err := finnhubClient.CryptoCandles(context.Background()).Symbol("BINANCE:" + strings.ToUpper(coin) + "USDC").Resolution(resolution).From(from.Unix()).To(to.Unix()).Execute()
if err != nil {
if req != nil {
log.Println(req.StatusCode)
Expand Down

0 comments on commit aad751c

Please sign in to comment.