This commit is contained in:
@@ -258,31 +258,33 @@ namespace AyaNova.Biz
|
||||
await LogJobAsync(job.GId, $"Process job \"{JobDescription}\"");
|
||||
log.LogDebug($"ProcessJobAsync -> Processing job {JobDescription}");
|
||||
IJobObject o = null;
|
||||
|
||||
switch (job.JobType)
|
||||
using (AyContext ct = ServiceProviderProvider.DBContext)
|
||||
{
|
||||
case JobType.Backup:
|
||||
//This is called when on demand only, normal backups are processed above with normal system jobs
|
||||
await CoreJobBackup.DoWorkAsync(true);
|
||||
await UpdateJobStatusAsync(job.GId, JobStatus.Completed);
|
||||
break;
|
||||
case JobType.TestJob:
|
||||
o = (IJobObject)BizObjectFactory.GetBizObject(AyaType.ServerJob);
|
||||
break;
|
||||
case JobType.SeedTestData:
|
||||
o = (IJobObject)BizObjectFactory.GetBizObject(AyaType.TrialSeeder);
|
||||
break;
|
||||
case JobType.BulkCoreBizObjectOperation:
|
||||
//bulk op, hand off to biz object to deal with
|
||||
//note, convention is that there is an idList in job.jobinfo json if preselected else it's all objects of type
|
||||
o = (IJobObject)BizObjectFactory.GetBizObject(job.ObjectType);
|
||||
break;
|
||||
default:
|
||||
throw new System.NotSupportedException($"ProcessJobAsync type {job.JobType.ToString()} is not supported");
|
||||
}
|
||||
switch (job.JobType)
|
||||
{
|
||||
case JobType.Backup:
|
||||
//This is called when on demand only, normal backups are processed above with normal system jobs
|
||||
await CoreJobBackup.DoWorkAsync(true);
|
||||
await UpdateJobStatusAsync(job.GId, JobStatus.Completed);
|
||||
break;
|
||||
case JobType.TestJob:
|
||||
o = (IJobObject)BizObjectFactory.GetBizObject(AyaType.ServerJob, ct);
|
||||
break;
|
||||
case JobType.SeedTestData:
|
||||
o = (IJobObject)BizObjectFactory.GetBizObject(AyaType.TrialSeeder, ct);
|
||||
break;
|
||||
case JobType.BulkCoreBizObjectOperation:
|
||||
//bulk op, hand off to biz object to deal with
|
||||
//note, convention is that there is an idList in job.jobinfo json if preselected else it's all objects of type
|
||||
o = (IJobObject)BizObjectFactory.GetBizObject(job.ObjectType, ct);
|
||||
break;
|
||||
default:
|
||||
throw new System.NotSupportedException($"ProcessJobAsync type {job.JobType.ToString()} is not supported");
|
||||
}
|
||||
|
||||
if (o != null)
|
||||
await o.HandleJobAsync(job);
|
||||
if (o != null)
|
||||
await o.HandleJobAsync(job);
|
||||
}
|
||||
log.LogDebug($"ProcessJobAsync -> Job completed {JobDescription}");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user