private void Reset() { if (_myTfsServer != null) { _myTfsServer.Dispose(); _myTfsServer = null; } _watchedBuildDefinitions = null; }
protected override IList <BuildStatus> GetBuildStatus() { try { if (_myTfsServer == null) { _myTfsServer = new MyTfsServer(CiEntryPointSetting); } if (_watchedBuildDefinitions == null) { _watchedBuildDefinitions = GetAllWatchedBuildDefinitions().ToArray(); } var buildDefinitionsByServer = _watchedBuildDefinitions.GroupBy(bd => bd.BuildServer); return(buildDefinitionsByServer.SelectMany( g => g.Key.GetBuildStatuses( g, CiEntryPointSetting.ApplyBuildQuality)).ToList()); } catch (DatabaseOperationTimeoutException ex) { Log.Warn(ex); throw new ServerUnavailableException(ex.Message, ex); } catch (DatabaseConnectionException ex) { throw new ServerUnavailableException(ex.Message, ex); } catch (TeamFoundationServiceUnavailableException ex) { throw new ServerUnavailableException(ex.Message, ex); } catch (BuildServerException ex) { Log.Error("Logging a BuildServerException as Server Unavailable Exception so SoS will continue to try to find the server", ex); throw new ServerUnavailableException(ex.Message, ex); } catch (WebException ex) { throw new ServerUnavailableException(ex.Message, ex); } catch (VersionControlException ex) { throw new ServerUnavailableException(ex.Message, ex); } catch (ThreadAbortException) { throw; } catch (ServerUnavailableException) { throw; } catch (Exception ex) { Log.Error("Error getting build status", ex); throw new ServerUnavailableException(ex.Message, ex); } }