mirror of
https://github.com/trezor/blockbook.git
synced 2026-02-19 16:31:19 +01:00
Normalized plan and improved url logic
This commit is contained in:
@@ -80,7 +80,9 @@ func NewCoinGeckoDownloader(db *db.RocksDB, network string, url string, coin str
|
||||
freeURL = "https://api.coingecko.com/api/v3"
|
||||
)
|
||||
|
||||
if apiKey != "" && (plan == "pro" || plan == "") {
|
||||
plan = strings.ToLower(strings.TrimSpace(plan))
|
||||
|
||||
if apiKey != "" && plan != "free" {
|
||||
url = proURL
|
||||
} else {
|
||||
url = freeURL
|
||||
@@ -103,6 +105,7 @@ func NewCoinGeckoDownloader(db *db.RocksDB, network string, url string, coin str
|
||||
db: db,
|
||||
throttlingDelay: time.Duration(throttlingDelayMs) * time.Millisecond,
|
||||
metrics: metrics,
|
||||
plan: plan,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user