case 4357

This commit is contained in:
2022-12-20 22:11:12 +00:00
parent b3bfa718d3
commit f3615b0f5f
3 changed files with 90 additions and 75 deletions

View File

@@ -374,12 +374,14 @@ namespace AyaNova.Biz
/// <returns></returns>
internal static async Task ProcessJobAsync(OpsJob job)
{
var JobDescription = $"{job.Name} - {job.JobType.ToString()}";
if (job.SubType != JobSubType.NotSet)
JobDescription += $":{job.SubType}";
await LogJobAsync(job.GId, $"LT:ProcessingJob \"{JobDescription}\"");
log.LogDebug($"ProcessJobAsync -> Processing job {JobDescription}");
IJobObject o = null;
try{
using (AyContext ct = ServiceProviderProvider.DBContext)
{
switch (job.JobType)
@@ -420,6 +422,12 @@ namespace AyaNova.Biz
await o.HandleJobAsync(job);
}
log.LogDebug($"ProcessJobAsync -> Job completed {JobDescription}");
}
catch(Exception ex){
await LogJobAsync(job.GId, $"LT:BatchJob \"{JobDescription}\" - LT:Failed ");
log.LogError(ex,$"ProcessJobAsync -> job failed {JobDescription}");
await JobsBiz.UpdateJobStatusAsync(job.GId, JobStatus.Failed);
}
}