feat: add offline indicator and increase CoinGecko cache to avoid rate limits

This commit is contained in:
2026-02-04 11:06:16 +01:00
parent 9f3ff3e3cb
commit 96538ab1db
3 changed files with 75 additions and 3 deletions

View File

@@ -16,8 +16,8 @@ const CURRENCY_SYMBOLS = {
JPY: '¥'
}
const CACHE_DURATION = 10 * 60 * 1000 // 10 minutes (CoinGecko free tier: 10-30 req/min)
const MIN_REQUEST_INTERVAL = 6 * 1000 // 6 seconds between requests (max ~10/min)
const CACHE_DURATION = 30 * 60 * 1000 // 30 minutes (CoinGecko free tier is strict)
const MIN_REQUEST_INTERVAL = 60 * 1000 // 60 seconds between requests
let cachedRates = null
let cacheTimestamp = 0