mirror of
https://github.com/actions/runner.git
synced 2025-12-10 12:36:23 +00:00
Compare commits
1 Commits
v2.293.1
...
users/logo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
17a36d58be |
@@ -160,8 +160,11 @@ namespace GitHub.Runner.Listener.Configuration
|
|||||||
}
|
}
|
||||||
|
|
||||||
TaskAgent agent;
|
TaskAgent agent;
|
||||||
|
int attemptCount = 5;
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
attemptCount--;
|
||||||
runnerSettings.AgentName = command.GetRunnerName();
|
runnerSettings.AgentName = command.GetRunnerName();
|
||||||
|
|
||||||
_term.WriteLine();
|
_term.WriteLine();
|
||||||
@@ -192,10 +195,10 @@ namespace GitHub.Runner.Listener.Configuration
|
|||||||
_term.WriteError("Failed to replace the runner. Try again or ctrl-c to quit");
|
_term.WriteError("Failed to replace the runner. Try again or ctrl-c to quit");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (command.Unattended)
|
else if (command.Unattended || attemptCount <= 0)
|
||||||
{
|
{
|
||||||
// if not replace and it is unattended config.
|
// if not replace and it is unattended config.
|
||||||
throw new TaskAgentExistsException($"Pool {runnerSettings.PoolId} already contains a runner with name {runnerSettings.AgentName}.");
|
throw new TaskAgentExistsException($"A runner already exists with the name {runnerSettings.AgentName}.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -216,6 +219,7 @@ namespace GitHub.Runner.Listener.Configuration
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add Agent Id to settings
|
// Add Agent Id to settings
|
||||||
runnerSettings.AgentId = agent.Id;
|
runnerSettings.AgentId = agent.Id;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user