mirror of
https://github.com/actions/runner.git
synced 2025-12-17 15:59:37 +00:00
Add retry logic around getting job messages from broker (#1939)
* Jsut simple solution without additional funcs * Delete old comment * resolve * Refactor retry function, make it more common * Make retry function generic, get rid of extra params * delete extra using * Add cancellation token and limit of attempts * Add some additional logging * Rework condition * replace to do..while * return `while (true)` to simplify code structure * Add other cancelling token, add TODO comment
This commit is contained in:
committed by
GitHub
parent
6bc6d475f9
commit
9499f477a2
@@ -474,10 +474,9 @@ namespace GitHub.Runner.Listener
|
||||
var credMgr = HostContext.GetService<ICredentialManager>();
|
||||
var creds = credMgr.LoadCredentials();
|
||||
|
||||
// todo: add retries https://github.com/github/actions-broker/issues/49
|
||||
var runServer = HostContext.CreateService<IRunServer>();
|
||||
await runServer.ConnectAsync(new Uri(settings.ServerUrl), creds);
|
||||
var jobMessage = await runServer.GetJobMessageAsync(messageRef.RunnerRequestId);
|
||||
var jobMessage = await runServer.GetJobMessageAsync(messageRef.RunnerRequestId, messageQueueLoopTokenSource.Token);
|
||||
|
||||
jobDispatcher.Run(jobMessage, runOnce);
|
||||
if (runOnce)
|
||||
|
||||
Reference in New Issue
Block a user