Include current runner status while getting messages (#2026)

* get messages with runner status

* fixed l0 tests

* PR feedback
This commit is contained in:
Lokesh Gopu
2022-07-28 16:42:02 -04:00
committed by GitHub
parent 72e2107b5e
commit 813af29886
9 changed files with 79 additions and 10 deletions

View File

@@ -360,6 +360,8 @@ namespace GitHub.Runner.Listener
bool runOnceJobReceived = false;
jobDispatcher = HostContext.CreateService<IJobDispatcher>();
jobDispatcher.JobStatus += _listener.OnJobStatus;
while (!HostContext.RunnerShutdownToken.IsCancellationRequested)
{
TaskAgentMessage message = null;
@@ -561,6 +563,7 @@ namespace GitHub.Runner.Listener
{
if (jobDispatcher != null)
{
jobDispatcher.JobStatus -= _listener.OnJobStatus;
await jobDispatcher.ShutdownAsync();
}