mirror of
https://github.com/actions/runner.git
synced 2025-12-13 10:05:23 +00:00
start calling run service for job completion (#2412)
* start calling run service for job completion * cleanup * nit: lines Co-authored-by: Tingluo Huang <tingluohuang@github.com> * clean up * give sanity back to thboop Co-authored-by: Thomas Boop <52323235+thboop@users.noreply.github.com> * add clean up back * clean up * clean up more * oops * copied from existing, but :thumb: Co-authored-by: Thomas Boop <52323235+thboop@users.noreply.github.com> --------- Co-authored-by: Tingluo Huang <tingluohuang@github.com> Co-authored-by: Thomas Boop <52323235+thboop@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
24a27efd4f
commit
e6e5f36dd0
@@ -62,14 +62,38 @@ namespace GitHub.DistributedTask.WebApi
|
||||
StreamID = messageId
|
||||
};
|
||||
|
||||
requestUri = new Uri(requestUri, "acquirejob");
|
||||
|
||||
var payloadJson = JsonUtility.ToString(payload);
|
||||
var requestContent = new StringContent(payloadJson, System.Text.Encoding.UTF8, "application/json");
|
||||
return SendAsync<Pipelines.AgentJobRequestMessage>(
|
||||
httpMethod,
|
||||
additionalHeaders: null,
|
||||
requestUri: requestUri,
|
||||
content: requestContent,
|
||||
cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
public Task CompleteJobAsync(
|
||||
Uri requestUri,
|
||||
Guid planId,
|
||||
Guid jobId,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
HttpMethod httpMethod = new HttpMethod("POST");
|
||||
var payload = new {
|
||||
PlanId = planId,
|
||||
JobId = jobId
|
||||
};
|
||||
|
||||
requestUri = new Uri(requestUri, "completejob");
|
||||
|
||||
var payloadJson = JsonUtility.ToString(payload);
|
||||
var requestContent = new StringContent(payloadJson, System.Text.Encoding.UTF8, "application/json");
|
||||
return SendAsync(
|
||||
httpMethod,
|
||||
requestUri,
|
||||
content: requestContent,
|
||||
cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user