Skip to content

Commit

Permalink
Merge pull request #46 from vegaprotocol/patch-panic
Browse files Browse the repository at this point in the history
feat: fix panic for coinmarketcap
  • Loading branch information
daniel1302 authored Nov 30, 2022
2 parents 64e27be + fe5863d commit 1ae3273
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions pricing/coinmarketcap.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func coinmarketcapStartFetching(
"URL": sourcecfg.URL.String(),
"rateLimitDuration": oneRequestEvery,
}).Errorln("failed to get trading data.")
continue
}

for _, price := range board.PriceList(sourcecfg.Name) {
Expand Down
5 changes: 3 additions & 2 deletions service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"net/http"
"strconv"
"strings"
"time"

"code.vegaprotocol.io/priceproxy/config"
Expand Down Expand Up @@ -163,8 +164,8 @@ func (s *Service) PricesGet(w http.ResponseWriter, r *http.Request, ps httproute

for k, v := range s.pe.GetPrices() {
if (source == "" || source == k.Source) &&
(base == "" || base == k.Base) &&
(quote == "" || quote == k.Quote) &&
(base == "" || strings.EqualFold(base, k.Base) || strings.EqualFold(base, k.BaseOverride)) &&
(quote == "" || strings.EqualFold(quote, k.Quote) || strings.EqualFold(quote, k.QuoteOverride)) &&
(wanderPtr == nil || *wanderPtr == k.Wander) {
returnedQuote := k.Quote
if k.QuoteOverride != "" {
Expand Down

0 comments on commit 1ae3273

Please sign in to comment.