Fix preloading issues

This commit is contained in:
2024-01-16 23:45:33 -08:00
parent 7c952c134a
commit 2d95fcb1a1

View File

@@ -54,7 +54,7 @@ namespace AS1024.GeoFeed.MinimalAPI
bool isCached = true; bool isCached = true;
try try
{ {
if (!memoryCache.TryGetValue("Geofeed", out List<IPGeoFeed>? feed)) if (!memoryCache.TryGetValue("GeoFeedData", out List<IPGeoFeed>? feed))
{ {
isCached = false; isCached = false;
feed = await provider.GetGeoFeedData(); feed = await provider.GetGeoFeedData();
@@ -62,7 +62,7 @@ namespace AS1024.GeoFeed.MinimalAPI
{ {
MemoryCacheEntryOptions cacheEntryOptions = new MemoryCacheEntryOptions() MemoryCacheEntryOptions cacheEntryOptions = new MemoryCacheEntryOptions()
.SetSlidingExpiration(TimeSpan.FromMinutes(15)); .SetSlidingExpiration(TimeSpan.FromMinutes(15));
memoryCache.Set("Geofeed", feed, cacheEntryOptions); memoryCache.Set("GeoFeedData", feed, cacheEntryOptions);
} }
} }