Skip to content

Commit

Permalink
ContainerJob execution startTime and endTime can be null
Browse files Browse the repository at this point in the history
  • Loading branch information
mburumaxwell committed Sep 19, 2023
1 parent 240ab1c commit b086585
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/Tingle.Dependabot/Workflow/UpdateRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public async Task DeleteAsync(UpdateJob job, CancellationToken cancellationToken
var rr = await resource.GetContainerAppJobExecutionAsync(execution.Data.Name, cancellationToken);
var properties = JsonNode.Parse(rr.GetRawResponse().Content.ToString())!.AsObject()["properties"]!;

//var status = execution.Data.Status.ToString() switch
//var status = execution.Data.Properties.Status.ToString() switch
var status = properties["status"]!.GetValue<string>() switch
{
"Succeeded" => UpdateJobStatus.Succeeded,
Expand All @@ -169,8 +169,8 @@ public async Task DeleteAsync(UpdateJob job, CancellationToken cancellationToken
}

// get the period
//DateTimeOffset? start = execution.Data.StartOn, end = execution.Data.EndOn;
DateTimeOffset? start = properties["startTime"]!.GetValue<DateTimeOffset?>(), end = properties["endTime"]!.GetValue<DateTimeOffset?>();
//DateTimeOffset? start = execution.Data.Properties.StartTime, end = execution.Data.Properties.EndTime;
DateTimeOffset? start = properties["startTime"]?.GetValue<DateTimeOffset?>(), end = properties["endTime"]?.GetValue<DateTimeOffset?>();

// create and return state
return new UpdateRunnerState(status, start, end);
Expand Down

0 comments on commit b086585

Please sign in to comment.