This commit is contained in:
2021-07-29 22:40:56 +00:00
parent 457ec4c4dd
commit 6b26cd1319

View File

@@ -5220,6 +5220,7 @@ namespace AyaNova.Biz
if (p == null)
{
log.LogError($"PMBiz - PM was not fetchable when attempting to process PM id: {pmid}, deleted during processing?");
//todo: NOTIFY FAIL
continue;
}
//make new workorder
@@ -5255,7 +5256,7 @@ namespace AyaNova.Biz
p.Active = false;
await ct.SaveChangesAsync();
log.LogTrace($"PMBiz:: PM {p.Serial} has reached it's stop generating date and has been automatically deactivated");
return;
continue;
}
//Re-schedule PM
@@ -5296,10 +5297,17 @@ namespace AyaNova.Biz
pmo.ETADate = addts(pmo.ETADate, tsAdd);
}
}
try
{
await ct.SaveChangesAsync();
}
catch (Exception ex)
{
log.LogError(ex, $"PMBiz::GenerateAsync error updating PM after generation {p.Serial}");
//todo: NOTIFY FAIL
continue;
}
}
}
}
@@ -5509,6 +5517,7 @@ namespace AyaNova.Biz
{
var err = $"PMBiz::NewServiceWorkOrderFromPMAsync error creating from PM {p.Serial}\r\n{biz.GetErrorsAsString()}";
log.LogError(err);
//todo: NOTIFY FAIL
return false;
}
return true;