protected override void DoWork(CancellationToken cancel) { while (!cancel.IsCancellationRequested) { Console.WriteLine("Fetching new builds from TFS"); if (TFSHelper.TryGetNewBuildFromTFS(tfsBuilds)) { Console.WriteLine("Found new builds"); TFSHelper.WriteTFSBuildToFile(TFSBUILDFILE, tfsBuilds); } else { Console.WriteLine("No new builds"); } Thread.Sleep(TFS_MONITOR_INTERVAL); } }