Skip to content

Commit

Permalink
Throw TimeoutException instead of OperationCanceledException on the f…
Browse files Browse the repository at this point in the history
…inal retry in DownloadRepositoryAction.
  • Loading branch information
TingluoHuang committed Sep 28, 2023
1 parent 462337a commit 62fd1e3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Runner.Worker/ActionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,11 @@ private async Task DownloadRepositoryActionAsync(IExecutionContext executionCont
Trace.Info("Action download has been cancelled.");
throw;
}
catch (OperationCanceledException ex) when (!executionContext.CancellationToken.IsCancellationRequested && retryCount >= 2)
{
Trace.Info($"Action download final retry timeout after {timeoutSeconds} seconds.");
throw new TimeoutException($"Action '{link}' download has timed out. Error: {ex.Message}");
}
catch (ActionNotFoundException)
{
Trace.Info($"The action at '{link}' does not exist");
Expand Down

0 comments on commit 62fd1e3

Please sign in to comment.