public static async T.Task <IEnumerable <Job> > GetJobsAsync( this CloudUtilities u, string lowPartitionKey, string highPartitionKey, int count = 100, JobType type = JobType.ClusRun, bool reverse = false, CancellationToken token = default(CancellationToken)) { var jobTable = u.GetJobsTable(); var partitionRange = u.GetPartitionKeyRangeString(lowPartitionKey, highPartitionKey); var rowKey = u.JobEntryKey; var q = TableQuery.CombineFilters( partitionRange, TableOperators.And, TableQuery.GenerateFilterCondition(CloudUtilities.RowKeyName, QueryComparisons.Equal, rowKey)); var results = await jobTable.QueryAsync <Job>(q, count, token); return(results.Select(r => { r.Item3.UpdatedAt = r.Item4; return r.Item3; })); }
public static T.Task <bool> UpdateTaskAsync(this CloudUtilities u, string jobPartitionKey, string taskKey, Action <Task> action, CancellationToken token, ILogger logger = null) => u.UpdateObjectAsync(u.GetJobsTable(), jobPartitionKey, taskKey, action, token, logger);
private static T.Task <bool> UpdateJobAsync(this CloudUtilities u, string jobPartitionKey, Action <Job> action, CancellationToken token, ILogger logger = null) => u.UpdateObjectAsync(u.GetJobsTable(), jobPartitionKey, u.JobEntryKey, action, token, logger);
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);