Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Commit

Permalink
Merge pull request #121 from Azure/isaac/JobEndTime
Browse files Browse the repository at this point in the history
Return null for EndTime for a job when job is still running
  • Loading branch information
ppathan authored Jan 9, 2019
2 parents 24b3f04 + fd03407 commit 8e663b1
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,20 @@ public JobServiceModel(JobResult jobResult, List<JobResult> deviceJobs) throws E
this.queryCondition = jobResult.getQueryCondition();
this.createdTimeUtc = jobResult.getCreatedTime();
this.startTimeUtc = jobResult.getStartTime();
this.endTimeUtc = jobResult.getEndTime();
this.endTimeUtc = null;
this.maxExecutionTimeInSeconds = jobResult.getMaxExecutionTimeInSeconds();

switch (JobStatus.valueOf(jobResult.getJobStatus().toString()))
{
case completed:
case failed:
case cancelled:
this.endTimeUtc = jobResult.getEndTime();
break;
default:
break;
}

this.jobType = JobType.fromAzureJobType(jobResult.getJobType());
this.jobStatus = JobStatus.fromAzureJobStatus(jobResult.getJobStatus());

Expand Down

0 comments on commit 8e663b1

Please sign in to comment.