Handle Coingecko Throttled error

This commit is contained in:
Martin Boehm 2024-02-21 23:56:42 +01:00
parent 913c0e5198
commit 2c84ed4eb2

View File

@ -144,7 +144,7 @@ func (cg *Coingecko) makeReq(url string, endpoint string) ([]byte, error) {
}
return resp, err
}
if err.Error() != "error code: 1015" && !strings.Contains(strings.ToLower(err.Error()), "exceeded the rate limit") {
if err.Error() != "error code: 1015" && !strings.Contains(strings.ToLower(err.Error()), "exceeded the rate limit") && !strings.Contains(strings.ToLower(err.Error()), "throttled") {
if cg.metrics != nil {
cg.metrics.CoingeckoRequests.With(common.Labels{"endpoint": endpoint, "status": "error"}).Inc()
}