Allow runner to check service connection in background. (#3542)

* Allow runner to check service connection in background.

* .

* .
This commit is contained in:
Tingluo Huang
2024-11-12 13:30:30 -05:00
committed by GitHub
parent d37a7ae14d
commit d16fb2c593
5 changed files with 208 additions and 11 deletions

View File

@@ -50,7 +50,8 @@ namespace GitHub.Runner.Worker
if (message.Variables.TryGetValue(Constants.Variables.System.OrchestrationId, out VariableValue orchestrationId) &&
!string.IsNullOrEmpty(orchestrationId.Value))
{
HostContext.UserAgents.Add(new ProductInfoHeaderValue("OrchestrationId", orchestrationId.Value));
// make the orchestration id the first item in the user-agent header to avoid get truncated in server log.
HostContext.UserAgents.Insert(0, new ProductInfoHeaderValue("OrchestrationId", orchestrationId.Value));
// make sure orchestration id is in the user-agent header.
VssUtil.InitializeVssClientSettings(HostContext.UserAgents, HostContext.WebProxy);