public static async T.Task <bool> UpdateJobAsync(this CloudUtilities u, JobType type, int jobId, Action <Job> action, CancellationToken token, ILogger logger = null) { var pKey = u.GetJobPartitionKey(type, jobId, true); bool result1 = await u.UpdateJobAsync(pKey, action, token, logger); pKey = u.GetJobPartitionKey(type, jobId, false); bool result2 = await u.UpdateJobAsync(pKey, action, token, logger); return(result1 && result2); }
public static T.Task <IEnumerable <Job> > GetJobsAsync( this CloudUtilities u, int lastId, int higherId = int.MaxValue, int count = 100, JobType type = JobType.ClusRun, bool reverse = false, CancellationToken token = default(CancellationToken)) { lastId = reverse && lastId == 0 ? int.MaxValue : lastId; higherId = reverse && higherId == int.MaxValue ? 0 : higherId; var lowJobPartitionKey = u.GetJobPartitionKey(type, lastId, reverse); var highJobPartitionKey = u.GetJobPartitionKey(type, higherId, reverse); return(u.GetJobsAsync(lowJobPartitionKey, highJobPartitionKey, count, type, reverse, token)); }
public static T.Task AddJobsEventAsync(this CloudUtilities u, JobType jobType, int jobId, Event e, CancellationToken token, ILogger logger = null) => u.GetJobsTable().InsertOrReplaceAsync(u.GetJobPartitionKey(jobType, jobId), u.GetEventsKey(e.Id), e, token);