Handle ForceTokenRefresh message (#3133)

* Handle ForceTokenRefresh message

* move to constants

* format
This commit is contained in:
Luke Tomlinson
2024-02-07 11:24:40 -05:00
committed by GitHub
parent bcc665a7a1
commit 651ea42e00
4 changed files with 28 additions and 2 deletions

View File

@@ -596,6 +596,10 @@ namespace GitHub.Runner.Listener
Trace.Info($"Service requests the hosted runner to shutdown. Reason: '{HostedRunnerShutdownMessage.Reason}'.");
return Constants.Runner.ReturnCode.Success;
}
else if (string.Equals(message.MessageType, TaskAgentMessageTypes.ForceTokenRefresh))
{
await _listener.RefreshListenerTokenAsync(messageQueueLoopTokenSource.Token);
}
else
{
Trace.Error($"Received message {message.MessageId} with unsupported message type {message.MessageType}.");