private void ProccessNotifications(object state)
        {
            StopTimer();

            var buildUpdates = _buildConfigurationService.GetLastBuildPerDefinition();

            if (_lastSeenBuilds != null)
            {
                // When polling after the first time we are interested in new builds or where the InProgress value has changed
                var changedBuilds = buildUpdates.Where(b => !_lastSeenBuilds.ContainsKey(b.Url) || _lastSeenBuilds[b.Url].InProgress != b.InProgress);
                foreach (var changedBuild in changedBuilds)
                {
                    OnBuildStatusChange?.Invoke(changedBuild);
                }
            }
            _lastSeenBuilds = buildUpdates.ToDictionary(b => b.Url);

            OnBuildPollComplete?.Invoke(buildUpdates.Any(b => b.GetBuildResult() == BuildResult.Failed));

            StartTimer(PollInterval);
        }
        private void ProccessNotifications(object state)
        {
            StopTimer();

            var buildUpdates = _buildConfigurationService.GetLastBuildPerDefinition();

            foreach (var build in buildUpdates)
            {
                if ((build.InProgress && build.StartTime > _lastNotificationCheckTime) ||
                    (!build.InProgress && build.LastFinished > _lastNotificationCheckTime))
                {
                    OnBuildStatusChange?.Invoke(build);
                }
            }

            OnBuildPollComplete?.Invoke(buildUpdates.Any(b => b.Result.ToBuildResult() == BuildResult.Failed));

            _lastNotificationCheckTime = DateTime.Now;

            StartTimer(PollInterval);
        }