This commit is contained in:
@@ -7,6 +7,7 @@ namespace AyaNova.Biz
|
||||
/// </summary>
|
||||
public enum JobStatus : int
|
||||
{
|
||||
Absent=0,
|
||||
Sleeping = 1,
|
||||
Running = 2,
|
||||
Completed = 3,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user