public void Monitor() { _log.Heading("Starting build monitoring"); foreach (var info in _buildService.Info) { _log.Info(info); } try { using (var blink1 = _blink1Factory.Create()) { while (true) { try { var latestBuildStatuses = _buildService.GetLatestBuildStatuses(); var consolidatedStatus = new ConsolidatedStatus(latestBuildStatuses); _blink1NotificationService.Notify(blink1, consolidatedStatus); } catch (Exception) { _log.Error("Unable to connect to build server"); } Thread.Sleep(2000); } } } catch (InvalidOperationException ex) { _log.Error(ex.Message); _log.Info("Connect blink(1) and restart the program"); while (true) { } } }