Aggiunti controlli x alcune condizioni errore in reboot notturni post blocco Jetco
This commit is contained in:
@@ -240,22 +240,6 @@ namespace IOB_MAN.Core.Services
|
||||
Task.Delay(100);
|
||||
}
|
||||
|
||||
#if false
|
||||
List<string> listNames = new List<string>();
|
||||
try
|
||||
{
|
||||
// chiudo per nome SE rimasti
|
||||
listNames = currIobConf
|
||||
.ListTarget
|
||||
.Select(x => x.Value.ExeName)
|
||||
.Where(x => !string.IsNullOrEmpty(x))
|
||||
.Distinct().ToList();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione DoCloseAll.02:{Environment.NewLine}{exc}");
|
||||
}
|
||||
#endif
|
||||
List<string> listNames = ListIobNames();
|
||||
if (listNames.Count > 0)
|
||||
{
|
||||
@@ -795,16 +779,16 @@ namespace IOB_MAN.Core.Services
|
||||
bool needRem = false;
|
||||
if (!isBusy)
|
||||
{
|
||||
// verifico se non sia già stato segnato x rimozione...)
|
||||
if (item2rem.Find(x => x != null && x.pID == item.pID) != null)
|
||||
try
|
||||
{
|
||||
needRem = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// verifico se esista il processo...
|
||||
try
|
||||
// verifico se non sia già stato segnato x rimozione...)
|
||||
if (item2rem.Find(x => x != null && x.pID == item.pID) != null)
|
||||
{
|
||||
needRem = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// verifico se esista il processo...
|
||||
if (processList.Count > 0)
|
||||
{
|
||||
var p = processList.FirstOrDefault(pr => pr.Id == item.pID);
|
||||
@@ -821,24 +805,24 @@ namespace IOB_MAN.Core.Services
|
||||
{
|
||||
needRem = true;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
needRem = true;
|
||||
}
|
||||
if (needRem)
|
||||
{
|
||||
if (!item2rem.Contains(item))
|
||||
if (needRem)
|
||||
{
|
||||
item2rem.Add(item);
|
||||
if (!item2rem.Contains(item))
|
||||
{
|
||||
item2rem.Add(item);
|
||||
}
|
||||
item.isRunning = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
item.isRunning = true;
|
||||
}
|
||||
item.isRunning = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
item.isRunning = true;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
needRem = true;
|
||||
}
|
||||
}
|
||||
return needRem;
|
||||
}
|
||||
@@ -1138,42 +1122,52 @@ namespace IOB_MAN.Core.Services
|
||||
/// <param name="startProc"></param>
|
||||
private void LoadConfAndStart(bool startProc)
|
||||
{
|
||||
int stepLoad = 0;
|
||||
try
|
||||
{
|
||||
Log.Info($"LoadConfAndStart | {stepLoad++:00}");
|
||||
string startDir = Path.GetDirectoryName(AppContext.BaseDirectory)!;
|
||||
Log.Trace($"LoadConfAndStart starting | startDir: {startDir} | target Framework: {AppContext.TargetFrameworkName}");
|
||||
ConfDirBase = startDir;
|
||||
// init configurazioni
|
||||
DoReloadConfig();
|
||||
Log.Info($"LoadConfAndStart | {stepLoad++:00}");
|
||||
|
||||
// init servizio Redis monitoring
|
||||
DoSetupRedis();
|
||||
Log.Trace($"Config setup done | ConfPathApp: {ConfPathApp} | ConfPathIob: {ConfPathIob}");
|
||||
Log.Info($"LoadConfAndStart | {stepLoad++:00}");
|
||||
|
||||
// sistemo log a INFO
|
||||
SetIobLogLevel("INFO");
|
||||
Log.Trace($"Log set to INFO");
|
||||
Log.Info($"LoadConfAndStart | {stepLoad++:00}");
|
||||
|
||||
if (startProc)
|
||||
{
|
||||
// chiudo eventuali processi in RUN
|
||||
DoCloseAll(false);
|
||||
Log.Info($"LoadConfAndStart | StartProc | {stepLoad++:00}");
|
||||
|
||||
// forzo chiusura processi "like" se configurato
|
||||
DoForceCloseByName();
|
||||
Log.Info($"LoadConfAndStart | StartProc | {stepLoad++:00}");
|
||||
|
||||
// avvio i processi...
|
||||
DoOpenAllChild();
|
||||
Log.Trace($"Child Opened");
|
||||
Log.Info($"LoadConfAndStart | StartProc | {stepLoad++:00}");
|
||||
|
||||
// avvio timers e schedulazioni varie
|
||||
StartScheduler();
|
||||
Log.Info($"LoadConfAndStart | StartProc | {stepLoad++:00}");
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Error in AppControlService.init:{Environment.NewLine}{exc}");
|
||||
}
|
||||
Log.Info($"LoadConfAndStart | DONE! | {stepLoad++:00}");
|
||||
}
|
||||
|
||||
private void DoForceCloseByName()
|
||||
|
||||
@@ -751,19 +751,22 @@ namespace IOB_MAN.Components.Compo
|
||||
private void ForceReload()
|
||||
{
|
||||
_lastRender = DateTime.Now;
|
||||
isLoading = true;
|
||||
var filtered = CurrRecords;
|
||||
if (!string.IsNullOrEmpty(IobTypeSel))
|
||||
filtered = filtered.Where(x => x.TgtName == IobTypeSel).ToList();
|
||||
if (CurrRecords != null && CurrRecords.Count > 0)
|
||||
{
|
||||
isLoading = true;
|
||||
var filtered = CurrRecords;
|
||||
if (!string.IsNullOrEmpty(IobTypeSel))
|
||||
filtered = filtered.Where(x => x.TgtName == IobTypeSel).ToList();
|
||||
|
||||
totalCount = filtered.Count();
|
||||
ListRecords = filtered
|
||||
.OrderBy(x => x.CodIOB)
|
||||
.Skip(numRecord * (currPage - 1))
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
isLoading = false;
|
||||
_ = InvokeAsync(StateHasChanged);
|
||||
totalCount = filtered.Count();
|
||||
ListRecords = filtered
|
||||
.OrderBy(x => x.CodIOB)
|
||||
.Skip(numRecord * (currPage - 1))
|
||||
.Take(numRecord)
|
||||
.ToList();
|
||||
isLoading = false;
|
||||
_ = InvokeAsync(StateHasChanged);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>4.0.2512.1208</Version>
|
||||
<Version>4.0.2512.1508</Version>
|
||||
<Configurations>Debug;Release;Remote_DEBUG</Configurations>
|
||||
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
Reference in New Issue
Block a user