Cleanup logs
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user