From fe475c1910c47fd03bbf880bd176cf7054aa1cad Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 16 May 2023 20:44:13 +0200 Subject: [PATCH] update cache a 7 gg x svg --- WebDoorCreator.Data/Services/QueueDataService.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/WebDoorCreator.Data/Services/QueueDataService.cs b/WebDoorCreator.Data/Services/QueueDataService.cs index 2711c41..06a4b5e 100644 --- a/WebDoorCreator.Data/Services/QueueDataService.cs +++ b/WebDoorCreator.Data/Services/QueueDataService.cs @@ -387,7 +387,7 @@ namespace WebDoorCreator.Data.Services if (numReq > 0) { var rawData = await redisDb.HashGetAsync(currKey, $"{DoorId}"); - if(rawData.HasValue) + if (rawData.HasValue) { dictResult.Add($"{DoorId}", $"{rawData}"); @@ -638,7 +638,7 @@ namespace WebDoorCreator.Data.Services { // salvo in area REDIS currSvgKey = new RedisKey($"{Constants.CALC_REQ_SVG_CACHE}:{sDoorId}:{sCurrVers}"); - await redisDb.StringSetAsync(currSvgKey, calcTask.SvgGen, DayLongCache); + await redisDb.StringSetAsync(currSvgKey, calcTask.SvgGen, WeekLongCache); // elimino dalle code proc/err await RequestProcessingRemove(sDoorId); await RequestErrRemove(sDoorId); @@ -650,7 +650,7 @@ namespace WebDoorCreator.Data.Services { // salvo in area REDIS currSvgKey = new RedisKey($"{Constants.CALC_REQ_ERRS}:{sDoorId}:{sCurrVers}"); - await redisDb.StringSetAsync(currSvgKey, calcTask.ErrorMsg, DayLongCache); + await redisDb.StringSetAsync(currSvgKey, calcTask.ErrorMsg, WeekLongCache); // elimino dalle code proc/done await RequestProcessingRemove(sDoorId); await RequestDoneRemove(sDoorId); @@ -990,6 +990,13 @@ namespace WebDoorCreator.Data.Services { get => TimeSpan.FromHours(24); } + /// + /// Durata cache di 24h + /// + private TimeSpan WeekLongCache + { + get => TimeSpan.FromHours(24 * 7); + } /// /// Durata cache lunga (+ perturbazione percentuale +/-10%)