This commit is contained in:
2020-06-16 17:47:50 +00:00
parent 0c7884b0d5
commit efd00fa51d
3 changed files with 38 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ namespace AyaNova.Biz
/// </summary>
public enum JobStatus : int
{
Absent=0,
Sleeping = 1,
Running = 2,
Completed = 3,

View File

@@ -138,6 +138,20 @@ namespace AyaNova.Biz
await ct.SaveChangesAsync();
}
}
/// <summary>
/// Get the status of a job
/// </summary>
/// <param name="jobId"></param>
internal static async Task<JobStatus> GetJobStatusAsync(Guid jobId)
{
using (AyContext ct = ServiceProviderProvider.DBContext)
{
var o = await ct.OpsJob.AsNoTracking().SingleOrDefaultAsync(z => z.GId == jobId);
if (o == null) return JobStatus.Absent;
return o.JobStatus;
}
}
#endregion Job ops
#region PROCESSOR