예제 #1
0
        private static IEnumerable <Build> GetBuilds(string id, long startEpoch, long endEpoch)
        {
            if (!Current.Settings.TeamCity.Enabled)
            {
                return(Enumerable.Empty <Build>());
            }

            // only show builds when zoomed in, say 5 days for starters?
            //TODO: Move this to a setting
            if ((endEpoch - startEpoch) > TimeSpan.FromDays(30).TotalSeconds)
            {
                return(new List <Build>());
            }

            var      node = DashboardData.GetNodeById(id);
            DateTime start = startEpoch.ToDateTime(), end = endEpoch.ToDateTime();

            return(BuildStatus.GetBuildsByServer(node.PrettyName).Where(b => b.StartDate >= start && b.StartDate <= end));
        }