Skip to content

Commit

Permalink
fix: debug
Browse files Browse the repository at this point in the history
  • Loading branch information
harsh-98 committed Sep 2, 2024
1 parent 600807c commit 1147533
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/redstone/redstone.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ func (r *RedStoneMgr) getAPIPrice(ts int64, token string, composite bool, provid
url := fmt.Sprintf("https://api.redstone.finance/prices?symbol=%s&provider=%s&toTimestamp=%d&limit=1", details.DataId,provider, tenthMillSec(ts))
res, err := http.Get(url)
if err != nil || res.StatusCode/100 != 2 {
if err == nil {
log.Warn(err, res.StatusCode)
} else {
log.Warn(err)
}
return new(big.Int)
}
// from historic api
Expand All @@ -135,6 +140,7 @@ func (r *RedStoneMgr) getAPIPrice(ts int64, token string, composite bool, provid
return new(big.Int)
}
if len(parsedResp) == 0 {
log.Warn(body)
// log.Warn("empty response from redstone api", url, token, "provider: ", provider)
if provider == "redstone" { // try on another provider
return r.getAPIPrice(ts, token, composite, "redstone-primary-prod")
Expand Down

0 comments on commit 1147533

Please sign in to comment.