Cleanup logs

This commit is contained in:
Michał Zieliński
2025-03-03 15:32:44 +01:00
parent b30a387be6
commit 3abed9da30

View File

@@ -471,37 +471,17 @@ public class LayersController : Controller
{ {
try try
{ {
_logsController.AddEntry(new LogEntry
{
Title = $"Processing: {type}",
Type = LogEntryType.Info,
LogType = LogType.Process,
CreatedAt = DateTime.UtcNow
});
var processWorkerLayers = _db.Layers var processWorkerLayers = _db.Layers
.Include(x => x.Records) .Include(x => x.Records)
.Where(x => .Where(x =>
x.Records!.Any(y => y.Code == "Type" && y.Desc1 == "ProcessWorker") && x.Records!.Any(y => y.Code == "Type" && y.Desc1 == "ProcessWorker") &&
x.Records!.Any(y => y.Code == "IsEnabled" && y.Desc1 == "True") && x.Records!.Any(y => y.Code == "IsEnabled" && y.Desc1 == "True") &&
x.Records!.Any(y => y.Code == "ProcessType" && y.Desc1 == type) x.Records!.Any(y => y.Code == "ProcessType" && y.Desc1 == type)
&& x.Number == 5586
) )
.OrderBy(x => x.CreatedAt) .OrderBy(x => x.CreatedAt)
.AsNoTracking() .AsNoTracking()
.ToList(); .ToList();
if (processWorkerLayers.Count == 0)
{
_logsController.AddEntry(new LogEntry
{
Title = "No Layers to process.",
Type = LogEntryType.Info,
LogType = LogType.Process,
CreatedAt = DateTime.UtcNow
});
}
foreach (var processWorker in processWorkerLayers) foreach (var processWorker in processWorkerLayers)
{ {
try try