handle conflict errors from run service (#2570)

* handle conflict errors from run service

* nit: formatting

* fix formatting
This commit is contained in:
Yashwanth Anantharaju
2023-04-27 13:59:12 -04:00
committed by GitHub
parent 58f3ff55aa
commit c8c47d4f27
5 changed files with 41 additions and 7 deletions

View File

@@ -52,7 +52,8 @@ namespace GitHub.Runner.Common
{
CheckConnection();
return RetryRequest<AgentJobRequestMessage>(
async () => await _runServiceHttpClient.GetJobMessageAsync(requestUri, id, cancellationToken), cancellationToken);
async () => await _runServiceHttpClient.GetJobMessageAsync(requestUri, id, cancellationToken), cancellationToken,
shouldRetry: ex => ex is not TaskOrchestrationJobAlreadyAcquiredException);
}
public Task CompleteJobAsync(Guid planId, Guid jobId, TaskResult result, Dictionary<String, VariableValue> outputs, IList<StepResult> stepResults, CancellationToken cancellationToken)