Skip to content

Commit

Permalink
fix: handle coingecko errors gracefully - not getting through in dock…
Browse files Browse the repository at this point in the history
…er but are locally and in cluster
  • Loading branch information
robcxyz committed Nov 10, 2023
1 parent 06fb386 commit a25f653
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/api/rest/stats_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/sudoblockio/icon-go-api/service"
"go.uber.org/zap"
"io/ioutil"
"log"
"net/http"
"time"
)
Expand Down Expand Up @@ -50,8 +49,10 @@ var MarketCap float64
func GetMarketCap() (float64, error) {
resp, err := http.Get("https://api.coingecko.com/api/v3/coins/icon")
if err != nil {
log.Fatalln(err)
return 0.0, err
}

defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return 0.0, err
Expand Down

0 comments on commit a25f653

Please sign in to comment.