Skip to content

Commit

Permalink
Remove workaround for reading ContainerApp Job execution (#1344)
Browse files Browse the repository at this point in the history
The library has since been updated; we no longer need a workaround.

See also, Azure/azure-sdk-for-net#38385
  • Loading branch information
mburumaxwell authored Sep 16, 2024
1 parent 2acc63a commit a7f21ac
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions server/Tingle.Dependabot/Workflow/UpdateRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,7 @@ public async Task DeleteAsync(UpdateJob job, CancellationToken cancellationToken
var execution = executions.SingleOrDefault();
if (execution is null) return null;

// this is a temporary workaround
// TODO: remove this after https://github.com/Azure/azure-sdk-for-net/issues/38385 is fixed
var rr = await resource.GetContainerAppJobExecutionAsync(execution.Data.Name, cancellationToken);
var properties = JsonNode.Parse(rr.GetRawResponse().Content.ToString())!.AsObject()["properties"]!;

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

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

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

0 comments on commit a7f21ac

Please sign in to comment.