From 051d64a46006aa2083447eaa1adc3665bbf6bb49 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 9 Oct 2017 14:45:00 -0400 Subject: [PATCH] use AbsoluteExpirationRelativeToNow --- src/Icons/Controllers/IconsController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Icons/Controllers/IconsController.cs b/src/Icons/Controllers/IconsController.cs index f86d2f2e9c..a781ad51a5 100644 --- a/src/Icons/Controllers/IconsController.cs +++ b/src/Icons/Controllers/IconsController.cs @@ -48,7 +48,7 @@ namespace Bit.Icons.Controllers var mappedDomain = _domainMappingService.MapDomain(uri.Host); var icon = await _memoryCache.GetOrCreateAsync(mappedDomain, async entry => { - entry.AbsoluteExpiration = DateTime.UtcNow.AddHours(_iconsSettings.CacheHours); + entry.AbsoluteExpirationRelativeToNow = new TimeSpan(_iconsSettings.CacheHours, 0, 0); var iconUrl = $"{_iconsSettings.BestIconBaseUrl}/icon?url={mappedDomain}&size=16..24..32"; var response = await _httpClient.GetAsync(iconUrl);