Change cache duration from minutes to days
Co-authored-by: clayschaad <11883505+clayschaad@users.noreply.github.com>
This commit is contained in:
parent
be741ca787
commit
c8e5904775
4 changed files with 4 additions and 4 deletions
|
|
@ -15,7 +15,7 @@
|
||||||
"MinBreakMinutes": 60,
|
"MinBreakMinutes": 60,
|
||||||
"MaxEarlyArrivalMinutes": 60,
|
"MaxEarlyArrivalMinutes": 60,
|
||||||
"MaxLateArrivalMinutes": 15,
|
"MaxLateArrivalMinutes": 15,
|
||||||
"CacheDurationMinutes": 15
|
"CacheDurationDays": 1
|
||||||
},
|
},
|
||||||
|
|
||||||
"Shifts": [
|
"Shifts": [
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ namespace ShiftScheduler.Services
|
||||||
{
|
{
|
||||||
var cacheOptions = new MemoryCacheEntryOptions
|
var cacheOptions = new MemoryCacheEntryOptions
|
||||||
{
|
{
|
||||||
AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(config.CacheDurationMinutes)
|
AbsoluteExpirationRelativeToNow = TimeSpan.FromDays(config.CacheDurationDays)
|
||||||
};
|
};
|
||||||
cache.Set(cacheKey, apiResponse, cacheOptions);
|
cache.Set(cacheKey, apiResponse, cacheOptions);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ namespace ShiftScheduler.Shared
|
||||||
public int MinBreakMinutes { get; set; } = 60;
|
public int MinBreakMinutes { get; set; } = 60;
|
||||||
public int MaxEarlyArrivalMinutes { get; set; } = 60;
|
public int MaxEarlyArrivalMinutes { get; set; } = 60;
|
||||||
public int MaxLateArrivalMinutes { get; set; } = 15;
|
public int MaxLateArrivalMinutes { get; set; } = 15;
|
||||||
public int CacheDurationMinutes { get; set; } = 15;
|
public int CacheDurationDays { get; set; } = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TransportConnection
|
public class TransportConnection
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ public class TransportServiceTests
|
||||||
MinBreakMinutes = 60,
|
MinBreakMinutes = 60,
|
||||||
MaxEarlyArrivalMinutes = 60,
|
MaxEarlyArrivalMinutes = 60,
|
||||||
MaxLateArrivalMinutes = 15,
|
MaxLateArrivalMinutes = 15,
|
||||||
CacheDurationMinutes = 15
|
CacheDurationDays = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
_transportService = new TransportService(_httpClient, config, _memoryCache);
|
_transportService = new TransportService(_httpClient, config, _memoryCache);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue