diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html
index 2b721c3..612edab 100644
--- a/Resources/ChangeLog.html
+++ b/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
WebDoorCreator - Egalware
- Version: 0.9.2403.0819
+ Version: 0.9.2403.0911
Release note:
-
diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt
index 5dd980f..b2e9b5d 100644
--- a/Resources/VersNum.txt
+++ b/Resources/VersNum.txt
@@ -1 +1 @@
-0.9.2403.0819
+0.9.2403.0911
diff --git a/Resources/manifest.xml b/Resources/manifest.xml
index 77b7353..f212fe5 100644
--- a/Resources/manifest.xml
+++ b/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 0.9.2403.0819
+ 0.9.2403.0911
http://nexus.steamware.net/repository/SWS/WDC/stable/WDC.UI.zip
http://nexus.steamware.net/repository/SWS/WDC/stable/ChangeLog.html
false
diff --git a/WebDoorCreator.Core/Constants.cs b/WebDoorCreator.Core/Constants.cs
index 2bf93d3..ba4b3f0 100644
--- a/WebDoorCreator.Core/Constants.cs
+++ b/WebDoorCreator.Core/Constants.cs
@@ -26,6 +26,7 @@ namespace WebDoorCreator.Core
public static readonly string CALC_REQ_PROC = $"{BASE_HASH}:CalcRequests:Processing";
public static readonly string CALC_REQ_DDF_CACHE = $"{BASE_HASH}:CalcRequests:CacheDDF";
public static readonly string CALC_REQ_SVG_CACHE = $"{BASE_HASH}:CalcRequests:CacheSVG";
+ public static readonly string CALC_REQ_VETO_REC = $"{BASE_HASH}:CalcRequests:VetoRecalc";
public static readonly string DOOR_TPL_LIST = $"{BASE_HASH}:Template:DoorList";
// REDIS KEY dati x registrazione statistiche esecuzione
diff --git a/WebDoorCreator.Data/Services/QueueDataService.cs b/WebDoorCreator.Data/Services/QueueDataService.cs
index fa53cfc..7d151d3 100644
--- a/WebDoorCreator.Data/Services/QueueDataService.cs
+++ b/WebDoorCreator.Data/Services/QueueDataService.cs
@@ -188,21 +188,6 @@ namespace WebDoorCreator.Data.Services
answ = $"{rawData}";
}
}
-#if false
- // se non trovata --> missing!
- if (string.IsNullOrEmpty(answ))
- {
- // 2024.02.15: se mancasse, provo a richiedere ricalcolo porta... se poi arriva, la
- // pagina in ascolto l'avrà aggiornata
-
- // leggo missing standard...
- string missingFilePath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/images", "MissingOrange.svg");
- if (File.Exists(missingFilePath))
- {
- answ = File.ReadAllText(missingFilePath);
- }
- }
-#endif
return answ;
}
@@ -214,7 +199,7 @@ namespace WebDoorCreator.Data.Services
public string DoorGetMissingSvg()
{
string answ = missingSvgContent;
- if(string.IsNullOrEmpty(answ))
+ if (string.IsNullOrEmpty(answ))
{
// fix dati img missing...
missingFilePath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot/images", "MissingOrange.svg");
@@ -223,10 +208,41 @@ namespace WebDoorCreator.Data.Services
missingSvgContent = File.ReadAllText(missingFilePath);
answ = missingSvgContent;
}
- }
+ }
return answ;
}
+ ///
+ /// Cerca nei VetoProc se ci sia x porta corrente
+ ///
+ ///
+ ///
+ public async Task DoorProcVetoGetAsync(int DoorId)
+ {
+ string answ = "";
+ // recupero da REDIS
+ var currVetoKey = new RedisKey($"{Constants.CALC_REQ_VETO_REC}:{DoorId}");
+ var rawData = await redisDb.StringGetAsync(currVetoKey);
+ if (rawData.HasValue)
+ {
+ answ = $"{rawData}";
+ }
+ return answ;
+ }
+
+ ///
+ /// imposta un VetoProc x porta corrente x 1 sec
+ ///
+ /// ID porta da vietare x ricalcolo
+ /// Durata veto in ms
+ ///
+ public async Task DoorProcVetoSetAsync(int DoorId, int msVeto)
+ {
+ // recupero da REDIS
+ var currVetoKey = new RedisKey($"{Constants.CALC_REQ_VETO_REC}:{DoorId}");
+ var rawData = await redisDb.StringSetAsync(currVetoKey, $"{DoorId}", TimeSpan.FromMilliseconds(msVeto));
+ }
+
///
/// Remove for single hash record
///
@@ -1256,10 +1272,10 @@ namespace WebDoorCreator.Data.Services
* se non trova riparte da 1
*
----------------------------------*/
- int currVers = 1;
+ int currVers = 0;
string sCurrVers = "";
// per prima cosa controllo se ho GIA' in coda qualcosa come richieste
- if (await NumRequestPending() > 0)
+ if (string.IsNullOrEmpty(sCurrVers) && await NumRequestPending() > 0)
{
var currPending = await RequestPending();
if (currPending != null)
@@ -1267,13 +1283,11 @@ namespace WebDoorCreator.Data.Services
if (currPending.ContainsKey(sDoorId))
{
sCurrVers = currPending[sDoorId];
- int.TryParse(sCurrVers, out currVers);
- currVers++;
}
}
}
// cerco coda errori
- if (await NumRequestErrors() > 0)
+ if (string.IsNullOrEmpty(sCurrVers) && await NumRequestErrors() > 0)
{
var currErrors = await RequestErr();
if (currErrors != null)
@@ -1281,13 +1295,11 @@ namespace WebDoorCreator.Data.Services
if (currErrors.ContainsKey(sDoorId))
{
sCurrVers = currErrors[sDoorId];
- int.TryParse(sCurrVers, out currVers);
- currVers++;
}
}
}
// cerco coda task completati
- if (await NumRequestDone() > 0)
+ if (string.IsNullOrEmpty(sCurrVers) && await NumRequestDone() > 0)
{
var currDone = await RequestDone();
if (currDone != null)
@@ -1295,11 +1307,12 @@ namespace WebDoorCreator.Data.Services
if (currDone.ContainsKey(sDoorId))
{
sCurrVers = currDone[sDoorId];
- int.TryParse(sCurrVers, out currVers);
- currVers++;
}
}
}
+ // calcolo ed incremento
+ int.TryParse(sCurrVers, out currVers);
+ currVers++;
// inserisco in coda x calcoli
await RequestPendingUpsert(sDoorId, $"{currVers}");
// metto in coda "last calc" la porta corrente x pulizia successiva
@@ -1404,6 +1417,7 @@ namespace WebDoorCreator.Data.Services
/// Path dell'immagine "missing"
///
private string missingFilePath = "";
+
///
/// Contenuto SVG dell'immagine missing
///
diff --git a/WebDoorCreator.UI/Components/DoorMan/DoorList.razor.cs b/WebDoorCreator.UI/Components/DoorMan/DoorList.razor.cs
index 3715914..f386a1b 100644
--- a/WebDoorCreator.UI/Components/DoorMan/DoorList.razor.cs
+++ b/WebDoorCreator.UI/Components/DoorMan/DoorList.razor.cs
@@ -259,10 +259,17 @@ namespace WebDoorCreator.UI.Components.DoorMan
isTpl = isClose;
await ReloadData();
}
+ private int lastOrderId = -1;
+ private DoorsSelectFilter lastFilt = new DoorsSelectFilter() { CurrPage = -1 };
protected override async Task OnParametersSetAsync()
{
- await ReloadData();
+ if (currOrderId != lastOrderId || !actFilter.Equals(lastFilt))
+ {
+ lastOrderId = currOrderId;
+ lastFilt = actFilter.clone();
+ await ReloadData();
+ }
}
///
@@ -287,7 +294,7 @@ namespace WebDoorCreator.UI.Components.DoorMan
// chiamo reset richieste
var list2Proc = await QDService.ResetQueueByDoorList(doorIdList);
-
+
// se ho porte da processare --> chiamo save...
string currDDF = "";
int currDoorId = 0;
@@ -373,17 +380,6 @@ namespace WebDoorCreator.UI.Components.DoorMan
}
}
}
-
-#if false
- if (DoorsList != null)
- {
- var currDoor = DoorsList.FirstOrDefault();
- if (currDoor?.OrderNav != null)
- {
- //orderStatus = currDoor.OrderNav.Status;
- }
- }
-#endif
}
}
}
diff --git a/WebDoorCreator.UI/Controllers/DoorImageController.cs b/WebDoorCreator.UI/Controllers/DoorImageController.cs
index 5004f40..52d6b6c 100644
--- a/WebDoorCreator.UI/Controllers/DoorImageController.cs
+++ b/WebDoorCreator.UI/Controllers/DoorImageController.cs
@@ -13,8 +13,6 @@ namespace WebDoorCreator.UI.Controllers
{
#region Public Constructors
- private static List DoorIdProc = new List();
-
public DoorImageController(IConfiguration configuration, QueueDataService cQDService, WebDoorCreatorService cWDCService)
{
Log.Info("Starting DoorImageController");
@@ -43,15 +41,17 @@ namespace WebDoorCreator.UI.Controllers
// se fosse vuoto...
if (string.IsNullOrEmpty(svgContent))
{
- if (DoorIdProc.Contains(DoorId))
+ string vetoReq = await QDService.DoorProcVetoGetAsync(DoorId);
+ if (string.IsNullOrEmpty(vetoReq))
{
- DoorIdProc.Remove(DoorId);
- }
- else
- {
- DoorIdProc.Add(DoorId);
+ await QDService.DoorProcVetoSetAsync(DoorId, 2000);
// richiede ricalcolo img
- svgContent = await SendRecalcReq(DoorId);
+ await SendRecalcReq(DoorId);
+
+ // attende ...
+ await Task.Delay(WaitReloadSvg);
+ // riprova lettura
+ svgContent = await QDService.DoorGetLastSvg(DoorId);
}
}
// se fosse vuoto...
@@ -60,10 +60,6 @@ namespace WebDoorCreator.UI.Controllers
// legge img vuota
svgContent = QDService.DoorGetMissingSvg();
}
- else
- {
- DoorIdProc.Remove(DoorId);
- }
var result = System.Text.Encoding.UTF8.GetBytes(svgContent);
return File(result, "image/svg+xml");
}
@@ -93,29 +89,22 @@ namespace WebDoorCreator.UI.Controllers
///
///
///
- private async Task SendRecalcReq(int DoorId)
+ private async Task SendRecalcReq(int DoorId)
{
- string answ = "";
- // richiede ricalcolo img
- List doorIdList = new List() { $"{DoorId}" };
- // chiamo reset richieste
- var list2Proc = await QDService.ResetQueueByDoorList(doorIdList);
- await Task.Delay(WaitReloadSvg);
-
- // recupero DDF ed invio x processing
if (DoorId > 0)
{
+ // richiede ricalcolo img
+ List doorIdList = new List() { $"{DoorId}" };
+ // chiamo reset richieste
+ var list2Proc = await QDService.ResetQueueByDoorList(doorIdList);
+ await Task.Delay(WaitReloadSvg);
+
+ // recupero DDF ed invio x processing
string currDDF = await WDService.DoorOpGetDDF(DoorId);
// versione corrente del DDF generato
int currVers = await QDService.SendCalcReq(DoorId, currDDF);
await Task.Delay(WaitReloadSvg);
}
-
- // attende ...
- await Task.Delay(WaitReloadSvg);
- // riprova lettura
- answ = await QDService.DoorGetLastSvg(DoorId);
- return answ;
}
#endregion Private Methods
diff --git a/WebDoorCreator.UI/WebDoorCreator.UI.csproj b/WebDoorCreator.UI/WebDoorCreator.UI.csproj
index bac46f1..67f84b5 100644
--- a/WebDoorCreator.UI/WebDoorCreator.UI.csproj
+++ b/WebDoorCreator.UI/WebDoorCreator.UI.csproj
@@ -3,7 +3,7 @@
net6.0
enable
- 0.9.2403.0819
+ 0.9.2403.0911
enable
aspnet-WebDoorCreator.UI-dfe95fed-1398-4144-bd43-8b3a765d6608