update cache a 7 gg x svg
This commit is contained in:
@@ -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);
|
||||
}
|
||||
/// <summary>
|
||||
/// Durata cache di 24h
|
||||
/// </summary>
|
||||
private TimeSpan WeekLongCache
|
||||
{
|
||||
get => TimeSpan.FromHours(24 * 7);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Durata cache lunga (+ perturbazione percentuale +/-10%)
|
||||
|
||||
Reference in New Issue
Block a user