From c8e59047752a4c6c1912a17926b7c991bfde991d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 24 Aug 2025 17:12:34 +0000 Subject: [PATCH] Change cache duration from minutes to days Co-authored-by: clayschaad <11883505+clayschaad@users.noreply.github.com> --- Server/appsettings.json | 2 +- Services/TransportService.cs | 2 +- Shared/TransportModels.cs | 2 +- ShiftScheduler.Services.Tests/TransportServiceTests.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Server/appsettings.json b/Server/appsettings.json index 295ba16..7263db2 100644 --- a/Server/appsettings.json +++ b/Server/appsettings.json @@ -15,7 +15,7 @@ "MinBreakMinutes": 60, "MaxEarlyArrivalMinutes": 60, "MaxLateArrivalMinutes": 15, - "CacheDurationMinutes": 15 + "CacheDurationDays": 1 }, "Shifts": [ diff --git a/Services/TransportService.cs b/Services/TransportService.cs index 4007bc5..2358350 100644 --- a/Services/TransportService.cs +++ b/Services/TransportService.cs @@ -37,7 +37,7 @@ namespace ShiftScheduler.Services { var cacheOptions = new MemoryCacheEntryOptions { - AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(config.CacheDurationMinutes) + AbsoluteExpirationRelativeToNow = TimeSpan.FromDays(config.CacheDurationDays) }; cache.Set(cacheKey, apiResponse, cacheOptions); } diff --git a/Shared/TransportModels.cs b/Shared/TransportModels.cs index 1dca09a..d0b1c8b 100644 --- a/Shared/TransportModels.cs +++ b/Shared/TransportModels.cs @@ -9,7 +9,7 @@ namespace ShiftScheduler.Shared public int MinBreakMinutes { get; set; } = 60; public int MaxEarlyArrivalMinutes { get; set; } = 60; public int MaxLateArrivalMinutes { get; set; } = 15; - public int CacheDurationMinutes { get; set; } = 15; + public int CacheDurationDays { get; set; } = 1; } public class TransportConnection diff --git a/ShiftScheduler.Services.Tests/TransportServiceTests.cs b/ShiftScheduler.Services.Tests/TransportServiceTests.cs index 7dcb77a..a1e30b0 100644 --- a/ShiftScheduler.Services.Tests/TransportServiceTests.cs +++ b/ShiftScheduler.Services.Tests/TransportServiceTests.cs @@ -31,7 +31,7 @@ public class TransportServiceTests MinBreakMinutes = 60, MaxEarlyArrivalMinutes = 60, MaxLateArrivalMinutes = 15, - CacheDurationMinutes = 15 + CacheDurationDays = 1 }; _transportService = new TransportService(_httpClient, config, _memoryCache);