From bbc1fd28c22ff991aacf696cf3d646a540e5aaf6 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Sun, 7 Jul 2024 10:09:48 +0000 Subject: [PATCH] change: .coins cache will expire after an hour --- src/NadekoBot/Modules/Searches/Crypto/CryptoService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/NadekoBot/Modules/Searches/Crypto/CryptoService.cs b/src/NadekoBot/Modules/Searches/Crypto/CryptoService.cs index 35b5837c4..e8af28ddf 100644 --- a/src/NadekoBot/Modules/Searches/Crypto/CryptoService.cs +++ b/src/NadekoBot/Modules/Searches/Crypto/CryptoService.cs @@ -230,7 +230,8 @@ public class CryptoService : INService var result = await _cache.GetOrAddAsync>(GetTopCoinsKey(), async () => await http.GetFromJsonAsync>( "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(); }