This commit is contained in:
2024-08-25 13:55:49 +02:00
parent 7d346397e2
commit 9f8f0dfd4c
2 changed files with 4 additions and 3 deletions

View File

@@ -8,6 +8,7 @@ namespace UIFixes.util {
static Dictionary<string, CachePrice> cache = new Dictionary<string, CachePrice>();
public static double? FetchPrice(string templateId) {
Console.WriteLine($"Get price for {templateId}");
if (cache.ContainsKey(templateId)) {
double secondsSinceLastUpdate = (DateTime.Now - cache[templateId].lastUpdate).TotalSeconds;
if (secondsSinceLastUpdate > 300)