Update x velocizzare ed evitare doppioni x tag case sensitive

This commit is contained in:
Samuele Locatelli
2022-12-29 17:41:53 +01:00
parent 7f9afdf5fb
commit 02f0743456
10 changed files with 50 additions and 26 deletions
+5 -2
View File
@@ -376,7 +376,8 @@ namespace MP.FileData.Controllers
foreach (var tag in Tags)
{
var foundTag = currTags.SingleOrDefault(x => x.TagId == tag);
var foundTag = currTags.SingleOrDefault(x => x.TagId.ToLower() == tag.ToLower());
//var foundTag = currTags.SingleOrDefault(x => x.TagId == tag);
// aggiungo i tags SE non ci fossero
if (foundTag == null)
{
@@ -542,12 +543,14 @@ namespace MP.FileData.Controllers
foreach (var tag in Tags)
{
var foundTag = currTags.SingleOrDefault(x => x.TagId == tag);
var foundTag = currTags.SingleOrDefault(x => x.TagId.ToLower() == tag.ToLower());
//var foundTag = currTags.SingleOrDefault(x => x.TagId == tag);
// aggiungo i tags SE non ci fossero
if (foundTag == null)
{
var newTag = new TagModel() { TagId = tag };
currTags.Add(newTag);
//localDbCtx.SaveChanges();
Tag4File.Add(newTag);
}
else
+4 -2
View File
@@ -148,7 +148,8 @@ namespace MP.FileData
// se nullo --> segnalo!
if (answ.Count == 0)
{
Log.Warn($"searchProgComment Attenzione Tag non trovati | {fileName} | pattern: {pattern}{Environment.NewLine}{fileContent}");
Log.Warn($"searchProgComment Attenzione Tag non trovati | {fileName} | pattern: {pattern}");
//Log.Trace($"{fileName}:{Environment.NewLine}{fileContent}");
}
return answ;
}
@@ -194,7 +195,8 @@ namespace MP.FileData
// se nullo --> segnalo!
if (answ.Count == 0)
{
Log.Warn($"searchProgComment Attenzione Tag non trovati | {fileName} | num tags: : {currRule.Tag2Collect.Count}{Environment.NewLine}{fileContent}");
Log.Warn($"searchTagListed Attenzione Tag non trovati | {fileName} | tags cercati: {currRule.Tag2Collect.Count}");
//Log.Trace($"{Environment.NewLine}{fileContent}");
}
return answ;
}
+13 -3
View File
@@ -1,8 +1,10 @@
using Microsoft.AspNetCore.Components;
using MP.FileData.DTO;
using MP.Prog.Data;
using NLog;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
@@ -14,7 +16,7 @@ namespace MP.Prog.Components
public void Dispose()
{
// Clear database context
ListRecords = null;
GC.Collect();
}
@@ -39,7 +41,6 @@ namespace MP.Prog.Components
await verificaTutte(maxHour);
setupMessages.Add($"Effettuata verifica e rilettura di {numChecks} files!");
await ReloadData();
}
protected async Task ArchiveSingleCheck(string idxMacchina, int maxHour)
@@ -49,7 +50,6 @@ namespace MP.Prog.Components
await verificaSingola(idxMacchina, maxHour, 2);
setupMessages.Add($"Effettuata verifica e rilettura di {numChecks} files!");
await ReloadData();
}
protected async Task ClearMessage()
@@ -86,6 +86,7 @@ namespace MP.Prog.Components
protected async Task ReloadData()
{
//sw.Restart();
await Task.Delay(1);
numChecks = 0;
ListRecords = await DataService.GetArchiveStatus();
@@ -94,16 +95,21 @@ namespace MP.Prog.Components
setupMessages = new List<string>();
showProgress = false;
percLoading = 0;
//sw.Stop();
//var elapsTime = sw.Elapsed;
//Log.Trace($"ArchiveStatus | ReloadData | # rec: {ListRecords.Count} | {elapsTime.TotalMilliseconds}ms");
}
#endregion Protected Methods
#region Private Fields
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
private List<ArchiveStatusDTO> ListRecords;
private int numChecks = 0;
private Stopwatch sw = new Stopwatch();
private int totalCount = 0;
#endregion Private Fields
@@ -118,6 +124,7 @@ namespace MP.Prog.Components
private async Task verificaSingola(string idxMacchina, int numDays, int numMacchine)
{
sw.Restart();
// recupero elenco macchine
percLoading += 100 / numMacchine;
numChecks = await DataService.updateMachineArchive(idxMacchina, numDays, true, false);
@@ -125,6 +132,9 @@ namespace MP.Prog.Components
setupMessages.Add($"{idxMacchina}: {numChecks} files");
await InvokeAsync(StateHasChanged);
await Task.Delay(1);
sw.Stop();
var elapsTime = sw.Elapsed;
Log.Trace($"verificaSingola | idxMacchina: {idxMacchina} | {elapsTime.TotalMilliseconds}ms");
}
private async Task verificaTutte(int numDays)
+11 -8
View File
@@ -22,13 +22,16 @@
"RegExRepFileName": false,
"ReplaceCR": false,
"Tag2Collect": [
"CNCTYPE",
"VENDOR",
"MODEL",
"MPIP",
"Customer",
"HostOS",
"HostName",
"HostAddr"
"CNCTYPE=",
"VENDOR=",
"MODEL=",
"MPIP=",
"Customer=",
"HostOS=",
"HostName=",
"HostAddr=",
"IP=",
"AUTO_CHANGE_ODL=",
"AUTO_SNAPSHOT_DOSSIER="
]
}
+7 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>MP.Prog</RootNamespace>
<Version>6.16.2212.2916</Version>
<Version>6.16.2212.2917</Version>
</PropertyGroup>
<ItemGroup>
@@ -31,6 +31,12 @@
<ProjectReference Include="..\MP.FileData\MP.FileData.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="logs\.placeholder">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath)" />
</Target>
+1 -1
View File
@@ -29,7 +29,7 @@
layout="${longdate} ${uppercase:${level}} ${message}" />
-->
<target xsi:type="File" name="fileTarget" fileName="${basedir}/logs/${shortdate}.log" layout="${longdate} | ${uppercase:${level}} | ${logger:shortName=false} | ${message}" />
<target xsi:type="ColoredConsole" name="consoleTarget" layout="${longdate} | ${uppercase:${level}} | ${logger:shortName=true}| ${message}" />
<target xsi:type="ColoredConsole" name="consoleTarget" layout="${longdate} | ${uppercase:${level}} | ${logger:shortName=true} | ${message}" />
</targets>
<rules>
@@ -6,23 +6,23 @@ by editing this MSBuild file. In order to learn more about this please visit htt
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>
</SiteUrlToLaunchAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<ExcludeApp_Data>false</ExcludeApp_Data>
<ProjectGuid>d9901b50-e61c-400c-b62c-fa060cf72c29</ProjectGuid>
<SelfContained>false</SelfContained>
<MSDeployServiceURL>https://iis03.egalware.com:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>Default Web Site/MP/PROG</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
<SkipExtraFilesOnServer>false</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<EnableMSDeployBackup>true</EnableMSDeployBackup>
<UserName>jenkins</UserName>
<_SavePWD>True</_SavePWD>
<_SavePWD>true</_SavePWD>
<TargetFramework>net6.0</TargetFramework>
<EnableMsDeployAppOffline>True</EnableMsDeployAppOffline>
<EnableMsDeployAppOffline>true</EnableMsDeployAppOffline>
</PropertyGroup>
</Project>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo gestione Programmi MAPO</i>
<h4>Versione: 6.16.2212.2916</h4>
<h4>Versione: 6.16.2212.2917</h4>
<br />
Note di rilascio:
<ul>
+1 -1
View File
@@ -1 +1 @@
6.16.2212.2916
6.16.2212.2917
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2212.2916</version>
<version>6.16.2212.2917</version>
<url>https://nexus.steamware.net/repository/SWS/MP-PROG/stable/LAST/MP.Prog.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-PROG/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>