Fix preloading issues
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user