public ListJobs ( |
||
options | The options to use when querying for jobs. | |
Результат | IEnumerable |
/// <summary> /// Waits for the job to complete /// </summary> public static PSCloudJob WaitForJobCompletion(BatchController controller, BatchAccountContext context, string jobId, string taskId) { BatchClient client = new BatchClient(controller.BatchManagementClient, controller.ResourceManagementClient); PSCloudJob job = client.ListJobs(new ListJobOptions(context)).First(cloudJob => cloudJob.Id == jobId); DateTime timeout = DateTime.Now.AddMinutes(10); while (job.State != JobState.Completed || DateTime.Now > timeout) { job = client.ListJobs(new ListJobOptions(context)).First(cloudJob => cloudJob.Id == jobId); TestMockSupport.Delay(20000); } return(job); }
/// <summary> /// Waits for the job to complete /// </summary> public static PSCloudJob WaitForJobCompletion(BatchController controller, BatchAccountContext context, string jobId, string taskId) { BatchClient client = new BatchClient(controller.BatchManagementClient, controller.ResourceManagementClient); PSCloudJob job = client.ListJobs(new ListJobOptions(context)).First(cloudJob => cloudJob.Id == jobId); DateTime timeout = DateTime.Now.AddMinutes(10); while (job.State != JobState.Completed || DateTime.Now > timeout) { job = client.ListJobs(new ListJobOptions(context)).First(cloudJob => cloudJob.Id == jobId); TestMockSupport.Delay(20000); } return job; }