diff options
| -rw-r--r-- | src/Program.cs | 4 | ||||
| -rw-r--r-- | src/Services/GrabberService.cs | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/Program.cs b/src/Program.cs index d751102..0b7930a 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -1,18 +1,16 @@ global using I2R.LightNews.Services; global using I2R.LightNews.Models; global using IOL.Helpers; -using System.Globalization; var builder = WebApplication.CreateBuilder(args); builder.Services.AddHttpClient(); +builder.Services.AddMemoryCache(); builder.Services.AddScoped<GrabberService>(); builder.Services.AddRazorPages().AddRazorRuntimeCompilation(); var app = builder.Build(); -CultureInfo.CurrentCulture = new CultureInfo("nb-no"); -CultureInfo.CurrentUICulture = new CultureInfo("nb-no"); app.UseStaticFiles(); app.UseStatusCodePages(); app.UseRouting(); diff --git a/src/Services/GrabberService.cs b/src/Services/GrabberService.cs index 4a92517..3974a9e 100644 --- a/src/Services/GrabberService.cs +++ b/src/Services/GrabberService.cs @@ -9,7 +9,7 @@ namespace I2R.LightNews.Services; public class GrabberService { private readonly ILogger<GrabberService> _logger; - private readonly MemoryCache _memoryCache; + private readonly IMemoryCache _memoryCache; private readonly HttpClient _http; private const string NrkPrefix = "nrkno"; private const int StaleTime = 1800; @@ -18,7 +18,7 @@ public class GrabberService HostPath = "AppData/__sitecache" }; - public GrabberService(ILogger<GrabberService> logger, HttpClient http, MemoryCache memoryCache) { + public GrabberService(ILogger<GrabberService> logger, HttpClient http, IMemoryCache memoryCache) { _logger = logger; _http = http; _memoryCache = memoryCache; |
