diff --git a/EgwCoreLib.Lux.Data/Controllers/LuxController.cs b/EgwCoreLib.Lux.Data/Controllers/LuxController.cs index d4aa5a7e..d906768d 100644 --- a/EgwCoreLib.Lux.Data/Controllers/LuxController.cs +++ b/EgwCoreLib.Lux.Data/Controllers/LuxController.cs @@ -5152,7 +5152,7 @@ namespace EgwCoreLib.Lux.Data.Controllers /// /// /// - internal async Task TemplateUpdateCost(int TemplateID) + internal async Task TemplateUpdateCostAsync(int TemplateID) { bool answ = false; //using (DataLayerContext dbCtx = new DataLayerContext(_config)) @@ -5217,7 +5217,7 @@ namespace EgwCoreLib.Lux.Data.Controllers } catch (Exception exc) { - Log.Error($"Eccezione durante TemplateUpdateCost{Environment.NewLine}{exc}"); + Log.Error($"Eccezione durante TemplateUpdateCostAsync{Environment.NewLine}{exc}"); } } return answ; diff --git a/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs b/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs index 92ad45b6..cad30d4c 100644 --- a/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs +++ b/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs @@ -2445,7 +2445,6 @@ namespace EgwCoreLib.Lux.Data.Services /// public async Task> TagsGetAllAsync() { - //using var activity = ActivitySource.StartActivity("TagsGetAllAsync"); using var activity = StartActivity(); string source = "DB"; List? result = new List(); @@ -2481,7 +2480,6 @@ namespace EgwCoreLib.Lux.Data.Services /// public async Task TemplateCloneAsync(TemplateModel rec2clone) { - //using var activity = ActivitySource.StartActivity("TemplateCloneAsync"); using var activity = StartActivity(); string source = "DB+REDIS"; // calcolo @@ -2490,7 +2488,6 @@ namespace EgwCoreLib.Lux.Data.Services await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:Template:*"); await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:TemplateRows:*"); activity?.SetTag("data.source", source); - //activity?.Stop(); LogTrace($"TemplateCloneAsync | {source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms"); return fatto; } @@ -2502,15 +2499,15 @@ namespace EgwCoreLib.Lux.Data.Services /// public async Task TemplateDeleteAsync(TemplateModel updRec) { - using var activity = ActivitySource.StartActivity("TemplateDeleteAsync"); + using var activity = StartActivity(); string source = "DB+REDIS"; // calcolo bool fatto = await dbController.TemplateDeleteAsync(updRec); // svuoto cache... await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:Template:*"); await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:TemplateRows:*"); - activity?.Stop(); - LogTrace($"TemplateDeleteAsync | {source} | {activity?.Duration.TotalMilliseconds}ms"); + activity?.SetTag("data.source", source); + LogTrace($"TemplateDeleteAsync | {source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms"); return fatto; } @@ -2520,9 +2517,8 @@ namespace EgwCoreLib.Lux.Data.Services /// public async Task> TemplateGetAllAsync() { + using var activity = StartActivity(); string source = "DB"; - Stopwatch sw = new Stopwatch(); - sw.Start(); List? result = new List(); // cerco in redis... string currKey = $"{redisBaseKey}:Template:ALL"; @@ -2544,8 +2540,8 @@ namespace EgwCoreLib.Lux.Data.Services { result = new List(); } - sw.Stop(); - Log.Debug($"TemplateGetAllAsync | {source} | {sw.Elapsed.TotalMilliseconds}ms"); + activity?.SetTag("data.source", source); + LogTrace($"TemplateGetAllAsync | {source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms"); return result; } @@ -2556,9 +2552,8 @@ namespace EgwCoreLib.Lux.Data.Services /// public async Task> TemplateRowByParentAsync(int templateID) { + using var activity = StartActivity(); string source = "DB"; - Stopwatch sw = new Stopwatch(); - sw.Start(); List? result = new List(); // cerco in redis... string currKey = $"{redisBaseKey}:TemplateRow:{templateID}"; @@ -2580,8 +2575,8 @@ namespace EgwCoreLib.Lux.Data.Services { result = new List(); } - sw.Stop(); - Log.Debug($"TemplateRowByParentAsync | {source} | {sw.Elapsed.TotalMilliseconds}ms"); + activity?.SetTag("data.source", source); + LogTrace($"TemplateRowByParentAsync | {source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms"); return result; } @@ -2592,15 +2587,15 @@ namespace EgwCoreLib.Lux.Data.Services /// public async Task TemplateRowCloneAsync(TemplateRowModel rec2clone) { - Stopwatch sw = new Stopwatch(); - sw.Start(); + using var activity = StartActivity(); + string source = "DB+REDIS"; // calcolo bool fatto = await dbController.TemplateRowCloneAsync(rec2clone); // svuoto cache... await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:Template:*"); await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:TemplateRow:*"); - sw.Stop(); - Log.Debug($"TemplateRowCloneAsync in {sw.Elapsed.TotalMilliseconds} ms"); + activity?.SetTag("data.source", source); + LogTrace($"TemplateRowCloneAsync | {source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms"); return fatto; } @@ -2611,15 +2606,15 @@ namespace EgwCoreLib.Lux.Data.Services /// public async Task TemplateRowDeleteAsync(TemplateRowModel updRec) { - Stopwatch sw = new Stopwatch(); - sw.Start(); + using var activity = StartActivity(); + string source = "DB+REDIS"; // calcolo bool fatto = await dbController.TemplateRowDeleteAsync(updRec); // svuoto cache... await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:Template:*"); await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:TemplateRow:*"); - sw.Stop(); - Log.Debug($"TemplateRowDeleteAsync in {sw.Elapsed.TotalMilliseconds} ms"); + activity?.SetTag("data.source", source); + LogTrace($"TemplateRowDeleteAsync | {source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms"); return fatto; } @@ -2630,16 +2625,16 @@ namespace EgwCoreLib.Lux.Data.Services /// public async Task> TemplateRowFixUid(int TemplateID) { + using var activity = StartActivity(); + string source = "DB+REDIS"; List answ = new List(); - Stopwatch sw = new Stopwatch(); - sw.Start(); // calcolo answ = dbController.TemplateRowFixUid(TemplateID); // svuoto cache... await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:Template:*"); await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:TemplateRow:*"); - sw.Stop(); - Log.Debug($"TemplateRowFixUid in {sw.Elapsed.TotalMilliseconds} ms"); + activity?.SetTag("data.source", source); + LogTrace($"TemplateRowFixUid | {source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms"); return answ; } @@ -2649,9 +2644,8 @@ namespace EgwCoreLib.Lux.Data.Services /// public async Task> TemplateRowGetAllAsync() { + using var activity = StartActivity(); string source = "DB"; - Stopwatch sw = new Stopwatch(); - sw.Start(); List? result = new List(); // cerco in redis... string currKey = $"{redisBaseKey}:TemplateRow:ALL"; @@ -2673,8 +2667,8 @@ namespace EgwCoreLib.Lux.Data.Services { result = new List(); } - sw.Stop(); - Log.Debug($"TemplateRowGetAllAsync | {source} | {sw.Elapsed.TotalMilliseconds}ms"); + activity?.SetTag("data.source", source); + LogTrace($"TemplateRowGetAllAsync | {source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms"); return result; } @@ -2688,8 +2682,8 @@ namespace EgwCoreLib.Lux.Data.Services /// public async Task TemplateRowUpdateAwaitStateAsync(int TemplateRowID, bool? awaitBom, bool? awaitPrice, bool flushCache = false) { - Stopwatch sw = new Stopwatch(); - sw.Start(); + using var activity = StartActivity(); + string source = "DB+REDIS"; // aggiorno bool fatto = await dbController.TemplateRowUpdateAwaitStateAsync(TemplateRowID, awaitBom, awaitPrice); if (flushCache) @@ -2697,8 +2691,8 @@ namespace EgwCoreLib.Lux.Data.Services // svuoto cache... await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:TemplateRow:*"); } - sw.Stop(); - Log.Debug($"TemplateRowUpdateAwaitStateAsync in {sw.Elapsed.TotalMilliseconds} ms"); + activity?.SetTag("data.source", source); + LogTrace($"TemplateRowUpdateAwaitStateAsync | {source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms"); return fatto; } @@ -2709,15 +2703,15 @@ namespace EgwCoreLib.Lux.Data.Services /// public async Task TemplateRowUpdateFileDataAsync(TemplateRowModel updRec) { - Stopwatch sw = new Stopwatch(); - sw.Start(); + using var activity = StartActivity(); + string source = "DB+REDIS"; // calcolo bool fatto = await dbController.TemplateRowUpdateFileDataAsync(updRec); // svuoto cache... await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:Template:*"); await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:TemplateRow:*"); - sw.Stop(); - Log.Debug($"TemplateRowUpdateFileDataAsync in {sw.Elapsed.TotalMilliseconds} ms"); + activity?.SetTag("data.source", source); + LogTrace($"TemplateRowUpdateFileDataAsync | {source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms"); return fatto; } @@ -2729,15 +2723,15 @@ namespace EgwCoreLib.Lux.Data.Services /// public async Task TemplateRowUpdateSerStructAsync(int TemplateRowID, string serStruct) { - Stopwatch sw = new Stopwatch(); - sw.Start(); + using var activity = StartActivity(); + string source = "DB+REDIS"; // calcolo bool fatto = await dbController.TemplateRowUpdateSerStructAsync(TemplateRowID, serStruct); // svuoto cache... await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:Template:*"); await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:TemplateRow:*"); - sw.Stop(); - Log.Debug($"TemplateRowUpdateSerStructAsync in {sw.Elapsed.TotalMilliseconds} ms"); + activity?.SetTag("data.source", source); + LogTrace($"TemplateRowUpdateSerStructAsync | {source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms"); return fatto; } @@ -2748,15 +2742,15 @@ namespace EgwCoreLib.Lux.Data.Services /// public async Task TemplateRowUpsertAsync(TemplateRowModel updRec) { - Stopwatch sw = new Stopwatch(); - sw.Start(); + using var activity = StartActivity(); + string source = "DB+REDIS"; // calcolo bool fatto = await dbController.TemplateRowUpsertAsync(updRec); // svuoto cache... await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:Template:*"); await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:TemplateRow:*"); - sw.Stop(); - Log.Debug($"TemplateRowUpsertAsync in {sw.Elapsed.TotalMilliseconds} ms"); + activity?.SetTag("data.source", source); + LogTrace($"TemplateRowUpsertAsync | {source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms"); return fatto; } @@ -2765,17 +2759,17 @@ namespace EgwCoreLib.Lux.Data.Services /// /// Key /// - public async Task TemplateUpdateCost(int TemplateID) + public async Task TemplateUpdateCostAsync(int TemplateID) { - Stopwatch sw = new Stopwatch(); - sw.Start(); + using var activity = StartActivity(); + string source = "DB+REDIS"; // calcolo - bool fatto = await dbController.TemplateUpdateCost(TemplateID); + bool fatto = await dbController.TemplateUpdateCostAsync(TemplateID); // svuoto cache... await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:Template:*"); await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:TemplateRow:*"); - sw.Stop(); - Log.Debug($"TemplateUpdateCost in {sw.Elapsed.TotalMilliseconds} ms"); + activity?.SetTag("data.source", source); + LogTrace($"TemplateUpdateCostAsync | {source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms"); return fatto; } @@ -2786,7 +2780,7 @@ namespace EgwCoreLib.Lux.Data.Services /// public async Task TemplateUpsertAsync(TemplateModel updRec) { - using var activity = ActivitySource.StartActivity("TemplateUpsertAsync"); + using var activity = StartActivity(); string source = "DB+REDIS"; // calcolo bool fatto = await dbController.TemplateUpsertAsync(updRec); @@ -2795,7 +2789,7 @@ namespace EgwCoreLib.Lux.Data.Services await ExecFlushRedisPatternAsync((RedisValue)$"{redisBaseKey}:TemplateRows:*"); activity?.SetTag("data.source", source); activity?.Stop(); - LogTrace($"TemplateUpsertAsync | {source} | {activity?.Duration.TotalMilliseconds}ms"); + LogTrace($"TemplateUpsertAsync | {source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms"); return fatto; } @@ -2821,7 +2815,7 @@ namespace EgwCoreLib.Lux.Data.Services protected bool ExecFlushRedisPattern(RedisValue pat2Flush) { bool answ = false; - using var activity = ActivitySource.StartActivity("ExecFlushRedisPattern"); + using var activity = StartActivity(); string source = "REDIS"; /******************************* * Recupero elenco dei server da cui cancellare le chiavi: @@ -2889,8 +2883,7 @@ namespace EgwCoreLib.Lux.Data.Services } activity?.SetTag("data.source", source); activity?.SetTag("param.pat2Flush", pat2Flush); - //activity?.Stop(); - LogTrace($"ExecFlushRedisPattern | {pat2Flush} | {source} | {activity?.Duration.TotalMilliseconds}ms"); + LogTrace($"ExecFlushRedisPattern | {pat2Flush} | {source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms"); return answ; } @@ -2902,7 +2895,7 @@ namespace EgwCoreLib.Lux.Data.Services protected async Task ExecFlushRedisPatternAsync(RedisValue pat2Flush) { bool answ = false; - using var activity = ActivitySource.StartActivity("ExecFlushRedisPatternAsync"); + using var activity = StartActivity(); string source = "REDIS"; /******************************* * Recupero elenco dei server da cui cancellare le chaivi: @@ -2968,8 +2961,7 @@ namespace EgwCoreLib.Lux.Data.Services } activity?.SetTag("data.source", source); activity?.SetTag("param.pat2Flush", pat2Flush); - //activity?.Stop(); - LogTrace($"ExecFlushRedisPatternAsync | {pat2Flush} | {source} | {activity?.Duration.TotalMilliseconds}ms"); + LogTrace($"ExecFlushRedisPatternAsync | {pat2Flush} | {source} | trace: {activity?.TraceId} | {activity?.Duration.TotalMilliseconds}ms"); return answ; } @@ -2989,41 +2981,5 @@ namespace EgwCoreLib.Lux.Data.Services #endregion Private Properties -#if false - /// - /// Elenco item Child da ParentId (per sostituzione) async - /// - /// ID corrente di cui cercare parent + fratelli - /// - public List ItemGetChild(int ItemId) - { - string source = "DB"; - Stopwatch sw = new Stopwatch(); - sw.Start(); - List? result = new List(); - // cerco in redis... - string currKey = $"{redisBaseKey}:Item:ListChild:{ItemId}"; - RedisValue rawData = redisDb.StringGet(currKey); - if (rawData.HasValue) - { - result = JsonConvert.DeserializeObject>($"{rawData}"); - source = "REDIS"; - } - else - { - result = dbController.ItemGetChild(ItemId); - // serializzo e salvo con config x evitare loop... - rawData = JsonConvert.SerializeObject(result, JSSettings); - redisDb.StringSet(currKey, rawData, FastCache); - } - if (result == null) - { - result = new List(); - } - sw.Stop(); - Log.Debug($"ItemGetChild | {source} | {sw.Elapsed.TotalMilliseconds}ms"); - return result; - } -#endif } } \ No newline at end of file diff --git a/Lux.API/Lux.API.csproj b/Lux.API/Lux.API.csproj index a1eda59e..e1675695 100644 --- a/Lux.API/Lux.API.csproj +++ b/Lux.API/Lux.API.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 1.1.2603.0618 + 1.1.2603.0619 diff --git a/Lux.UI/Lux.UI.csproj b/Lux.UI/Lux.UI.csproj index 56680ad2..6a086514 100644 --- a/Lux.UI/Lux.UI.csproj +++ b/Lux.UI/Lux.UI.csproj @@ -5,7 +5,7 @@ enable enable aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50 - 1.1.2603.0618 + 1.1.2603.0619 diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index 7fac7164..7725afc2 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ LUX - Web Windows MES -

Versione: 1.1.2603.0618

+

Versione: 1.1.2603.0619


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index e2fa213a..a26ce497 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -1.1.2603.0618 +1.1.2603.0619 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index 22711701..53458287 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.1.2603.0618 + 1.1.2603.0619 http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html false