Merge branch 'release/AddCheckEnableAndError_01'

This commit is contained in:
Samuele Locatelli
2025-07-21 12:50:12 +02:00
7 changed files with 47 additions and 8 deletions
+4 -1
View File
@@ -171,7 +171,10 @@ namespace Maat.Data.Controllers
}
catch (Exception exc)
{
Log.Error($"{tName} | Eccezione in ExecuteSqlTask{Environment.NewLine}Call eseguita:{Environment.NewLine}{sqlCall}{Environment.NewLine}------- Stack Eccezione -------{Environment.NewLine}{exc}");
string excMsg = $"{tName} | Eccezione in ExecuteSqlTask{Environment.NewLine}Call eseguita:{Environment.NewLine}{sqlCall}{Environment.NewLine}------- Stack Eccezione -------{Environment.NewLine}{exc}";
callRes.ExecResult = -1;
callRes.TextResult = excMsg;
Log.Error(excMsg);
}
}
return callRes;
+10
View File
@@ -20,11 +20,21 @@ namespace Maat.Data.DbModels
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int TaskId { get; set; } = 0;
/// <summary>
/// Gruppo task (per gestione precedenze e semaforo exec)
/// </summary>
public int Group { get; set; } = 1;
/// <summary>
/// Ordinale x esecuzione
/// </summary>
public int Ordinal { get; set; } = 0;
/// <summary>
/// Stato Task abilitato / disabilitato
/// </summary>
public bool Enabled { get; set; } = false;
/// <summary>
/// Nome Task
/// </summary>
+29 -3
View File
@@ -67,19 +67,45 @@ namespace Maat.Data.Services
List<TaskListModel> listTask = TaskListAll(tName, Enums.Task2ExeType.ND, "");
// verifico SE ci siano task in scadenza...
DateTime adesso = DateTime.Now;
List<TaskListModel> task2exe = listTask.Where(x => x.DtNextExec <= adesso).ToList();
List<TaskListModel> task2exe = listTask.Where(x => x.Enabled && x.DtNextExec <= adesso).ToList();
int numDone = 0;
if (task2exe != null && task2exe.Count > 0)
{
Log.Info($"{tName} | Found {task2exe.Count} task to execute");
// suddivisione x gruppi
var ListGrouped = task2exe
.OrderBy(x => x.Group)
.ThenBy(x => x.Ordinal)
.GroupBy(x => x.Group)
.ToDictionary(g => g.Key, g => g.ToList());
// ciclo, e all'interno del gruppo SE non passa uno step si ferma....
foreach (var taskGroup in ListGrouped)
{
foreach (var taskRec in taskGroup.Value)
{
TaskResultModel result = ExecuteTask(taskRec);
answ.Add(result);
numDone++;
// SE non eseguito --> esce, come anche se passato timeout (e ultima esecuzione è prima della scadenza..
if (result.ExecResult < 0)
{
break;
}
}
}
#if false
foreach (var taskRec in task2exe)
{
TaskResultModel result = ExecuteTask(taskRec);
answ.Add(result);
}
}
#endif
}
else
{
Log.Trace($"{tName} | Chiamata CheckExecute");
Log.Trace($"{tName} | Chiamata CheckExecute | eseguiti {numDone} task");
}
// resituisco
return answ;
+1 -1
View File
@@ -5,7 +5,7 @@
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>1.2.2506.0509</Version>
<Version>1.2.2507.2112</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Maat.Installer - Manager for Application & Applicative Task</i>
<h4>Versione: 1.2.2506.0509</h4>
<h4>Versione: 1.2.2507.2112</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
1.2.2506.0509
1.2.2507.2112
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.2.2506.0509</version>
<version>1.2.2507.2112</version>
<url>http://nexus.steamware.net/repository/SWS/Maat.Installer/stable/LAST/Maat.Installer.msi</url>
<changelog>http://nexus.steamware.net/repository/SWS/Maat.Installer/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>