This commit is contained in:
Luke Tomlinson
2023-03-23 11:10:35 -07:00
parent 0989ee93d6
commit 0f8ed8f7fc
2 changed files with 5 additions and 24 deletions

13
.vscode/launch.json vendored
View File

@@ -12,10 +12,7 @@
], ],
"cwd": "${workspaceFolder}/src", "cwd": "${workspaceFolder}/src",
"console": "integratedTerminal", "console": "integratedTerminal",
"requireExactSource": false, "requireExactSource": false
"env": {
"USE_BROKER_FLOW": "1"
}
}, },
{ {
"name": "Run", "name": "Run",
@@ -27,10 +24,7 @@
], ],
"cwd": "${workspaceFolder}/src", "cwd": "${workspaceFolder}/src",
"console": "integratedTerminal", "console": "integratedTerminal",
"requireExactSource": false, "requireExactSource": false
"env": {
"USE_BROKER_FLOW": "1"
}
}, },
{ {
"name": "Configure", "name": "Configure",
@@ -60,4 +54,5 @@
"requireExactSource": false "requireExactSource": false
}, },
], ],
} }

View File

@@ -25,7 +25,6 @@ namespace GitHub.Runner.Listener
private TaskAgentStatus runnerStatus = TaskAgentStatus.Online; private TaskAgentStatus runnerStatus = TaskAgentStatus.Online;
private CancellationTokenSource _getMessagesTokenSource; private CancellationTokenSource _getMessagesTokenSource;
private IBrokerServer _brokerServer; private IBrokerServer _brokerServer;
private string lastRunnerRequestId;
public override void Initialize(IHostContext hostContext) public override void Initialize(IHostContext hostContext)
{ {
@@ -80,20 +79,7 @@ namespace GitHub.Runner.Listener
continue; continue;
} }
if (MessageUtil.IsRunServiceJob(message.MessageType)) return message;
{
var messageRef = StringUtil.ConvertFromJson<RunnerJobRequestRef>(message.Body);
if (messageRef.RunnerRequestId != lastRunnerRequestId)
{
lastRunnerRequestId = messageRef.RunnerRequestId;
return message;
}
}
else
{
return message;
}
} }
catch (OperationCanceledException) when (_getMessagesTokenSource.Token.IsCancellationRequested && !token.IsCancellationRequested) catch (OperationCanceledException) when (_getMessagesTokenSource.Token.IsCancellationRequested && !token.IsCancellationRequested)
{ {