Fix png loghi

This commit is contained in:
Samuele Locatelli
2023-05-17 08:04:47 +02:00
parent 3e6c76aec5
commit e7eb191ef4
8 changed files with 36 additions and 36 deletions
@@ -150,6 +150,30 @@ namespace WebDoorCreator.Data.Services
return errVal.ToString();
}
/// <summary>
/// Cerca nelle esecuzioni ultimo SVG della porta e lo restituisce...
/// </summary>
/// <param name="DoorId"></param>
/// <returns></returns>
public async Task<string> DoorGetLastSvg(int DoorId)
{
string answ = "";
// cerco in hashtable dei task eseguiti ultimo x porta corrente...
var doorData = await RequestDoneGetSingle(DoorId);
if (doorData != null && doorData.Count > 0)
{
var firstRecord = doorData.FirstOrDefault();
// recupero da REDIS
var currSvgKey = new RedisKey($"{Constants.CALC_REQ_SVG_CACHE}:{firstRecord.Key}:{firstRecord.Value}");
var rawData = await redisDb.StringGetAsync(currSvgKey);
if (rawData.HasValue)
{
answ = $"{rawData}";
}
}
return answ;
}
/// <summary>
/// Remove for single hash record
/// </summary>
@@ -369,6 +393,7 @@ namespace WebDoorCreator.Data.Services
Log.Debug($"RequestDone | {source} in: {ts.TotalMilliseconds} ms");
return dictResult;
}
/// <summary>
/// Get LAST request done for DoorId
/// </summary>
@@ -390,7 +415,6 @@ namespace WebDoorCreator.Data.Services
if (rawData.HasValue)
{
dictResult.Add($"{DoorId}", $"{rawData}");
}
}
stopWatch.Stop();
@@ -663,29 +687,6 @@ namespace WebDoorCreator.Data.Services
}
return answ;
}
/// <summary>
/// Cerca nelle esecuzioni ultimo SVG della porta e lo restituisce...
/// </summary>
/// <param name="DoorId"></param>
/// <returns></returns>
public async Task<string> DoorGetLastSvg(int DoorId)
{
string answ = "";
// cerco in hashtable dei task eseguiti ultimo x porta corrente...
var doorData = await RequestDoneGetSingle(DoorId);
if (doorData != null && doorData.Count > 0)
{
var firstRecord = doorData.FirstOrDefault();
// recupero da REDIS
var currSvgKey = new RedisKey($"{Constants.CALC_REQ_SVG_CACHE}:{firstRecord.Key}:{firstRecord.Value}");
var rawData = await redisDb.StringGetAsync(currSvgKey);
if (rawData.HasValue)
{
answ = $"{rawData}";
}
}
return answ;
}
/// <summary>
/// Invio richiesta di calcolo per la porta indicata, dato il suo DDF
@@ -990,13 +991,6 @@ 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%)
@@ -1022,6 +1016,14 @@ namespace WebDoorCreator.Data.Services
get => TimeSpan.FromSeconds(cacheTtlLong * 10 * rnd.Next(900, 1100) / 1000);
}
/// <summary>
/// Durata cache di 24h
/// </summary>
private TimeSpan WeekLongCache
{
get => TimeSpan.FromHours(24 * 7);
}
#endregion Private Properties
#region Private Methods