Ejemplo n.º 1
0
        protected override void DoRun(CancellationToken token)
        {
            Job job = null;

            while (!token.IsCancellationRequested)
            {
                if (!Fetcher.GetJob(ref job))
                {
                    Sleeper.Sleep();
                    continue;
                }

                if (job == null)
                {
                    Logger.Error("Fetcher returned null job reference");
                    throw new NullReferenceException("GetJob returned null job");
                }

                string json = null;
                if (RunTestMachine(job, ref json))
                {
                    Comm.PutReport(json);
                    Sleeper.Reset();
                }
                Sleeper.Sleep();
            }
        }