diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2018-12-29 15:53:11 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2018-12-29 15:53:11 -0500 |
commit | 5db5ca1c88cf6592ceb4304d3b0682394050bbc8 (patch) | |
tree | ae7d098ffae5cccb462922f151617a9d3f66a9c0 /src/SMAPI.Web/Controllers/ModsController.cs | |
parent | 29907844331b258db6b9760eb7ed9131eccfa83f (diff) | |
download | SMAPI-5db5ca1c88cf6592ceb4304d3b0682394050bbc8.tar.gz SMAPI-5db5ca1c88cf6592ceb4304d3b0682394050bbc8.tar.bz2 SMAPI-5db5ca1c88cf6592ceb4304d3b0682394050bbc8.zip |
reduce cache time for mod compatibility list
Diffstat (limited to 'src/SMAPI.Web/Controllers/ModsController.cs')
-rw-r--r-- | src/SMAPI.Web/Controllers/ModsController.cs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/SMAPI.Web/Controllers/ModsController.cs b/src/SMAPI.Web/Controllers/ModsController.cs index 1ac0aff2..ca866a8d 100644 --- a/src/SMAPI.Web/Controllers/ModsController.cs +++ b/src/SMAPI.Web/Controllers/ModsController.cs @@ -22,7 +22,7 @@ namespace StardewModdingAPI.Web.Controllers private readonly IMemoryCache Cache; /// <summary>The number of minutes successful update checks should be cached before refetching them.</summary> - private readonly int SuccessCacheMinutes; + private readonly int CacheMinutes; /********* @@ -31,12 +31,12 @@ namespace StardewModdingAPI.Web.Controllers /// <summary>Construct an instance.</summary> /// <param name="cache">The cache in which to store mod metadata.</param> /// <param name="configProvider">The config settings for mod update checks.</param> - public ModsController(IMemoryCache cache, IOptions<ModUpdateCheckConfig> configProvider) + public ModsController(IMemoryCache cache, IOptions<ModCompatibilityListConfig> configProvider) { - ModUpdateCheckConfig config = configProvider.Value; + ModCompatibilityListConfig config = configProvider.Value; this.Cache = cache; - this.SuccessCacheMinutes = config.SuccessCacheMinutes; + this.CacheMinutes = config.CacheMinutes; } /// <summary>Display information for all mods.</summary> @@ -66,7 +66,7 @@ namespace StardewModdingAPI.Web.Controllers .OrderBy(p => Regex.Replace(p.Name.ToLower(), "[^a-z0-9]", "")) // ignore case, spaces, and special characters when sorting ); - entry.AbsoluteExpiration = DateTimeOffset.UtcNow.AddMinutes(this.SuccessCacheMinutes); + entry.AbsoluteExpiration = DateTimeOffset.UtcNow.AddMinutes(this.CacheMinutes); return model; }); } |