change: .coins cache will expire after an hour

This commit is contained in:
Kwoth
2024-07-07 10:09:48 +00:00
parent cff8a258d0
commit bbc1fd28c2

View File

@@ -230,7 +230,8 @@ public class CryptoService : INService
var result = await _cache.GetOrAddAsync<IReadOnlyCollection<GeckoCoinsResult>>(GetTopCoinsKey(),
async () => await http.GetFromJsonAsync<List<GeckoCoinsResult>>(
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=250")
?? []);
?? [],
expiry: TimeSpan.FromHours(1));
return result!.Skip(page * 10).Take(10).ToList();
}