Remove cancelled layers from processors
This commit is contained in:
@@ -15,13 +15,14 @@ public class T5LastValuesProcessor(
|
||||
var month = int.Parse(processWorker.Records?.SingleOrDefault(x => x.Code == "Month")?.Desc1!);
|
||||
var sourceLayer = processWorker.Records?.SingleOrDefault(x => x.Code == "SourceLayer")?.Desc1;
|
||||
if (sourceLayer == null) throw new Exception("SourceLayer record not found");
|
||||
var sourceImportWorker = db.Layers.SingleOrDefault(x => x.Name == sourceLayer);
|
||||
var sourceImportWorker = db.Layers.SingleOrDefault(x => x.Name == sourceLayer && !x.IsDeleted && !x.IsCancelled);
|
||||
if (sourceImportWorker == null) throw new Exception("SourceImportWorker layer not found");
|
||||
var source = processWorker.Records?.SingleOrDefault(x => x.Code == "Source")?.Desc1;
|
||||
if (sourceLayer == null) throw new Exception("Source record not found");
|
||||
|
||||
var processedLayer = db.Layers
|
||||
.Where(x => x.ParentId == processWorker.Id)
|
||||
.Where(x => x.ParentId == processWorker.Id
|
||||
&& !x.IsDeleted && !x.IsCancelled)
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.FirstOrDefault();
|
||||
|
||||
@@ -51,7 +52,7 @@ public class T5LastValuesProcessor(
|
||||
var dataSources = db.Layers
|
||||
.Include(x => x.Records)
|
||||
.Where(x => x.ParentId == sourceImportWorker.Id
|
||||
&& !x.IsDeleted)
|
||||
&& !x.IsDeleted && !x.IsCancelled)
|
||||
.OrderByDescending(x => x.CreatedAt)
|
||||
.AsNoTracking()
|
||||
.ToList();
|
||||
|
||||
Reference in New Issue
Block a user