Ejemplo n.º 1
0
        public override void Up()
        {
            Execute.Code(database =>
            {
                var existing = SprintProgress.Get(55);
                var compare  = new DateTime(2017, 03, 22, 00, 00, 00);
                if (existing.Any(x => x.DateTime == compare))
                {
                    return(string.Empty);
                }

                database.Insert(new SprintProgressDto {
                    SprintId = 55, DateTime = new DateTime(2017, 03, 22, 00, 00, 00), JsonData = "{\"Points\":{\"Open\":59.5,\"In Progress\":25.5,\"Review\":36.0,\"Reopened\":1.0,\"Fixed\":41.0,\"Other\":3.0},\"Unscheduled\":23.0}"
                });

                return(string.Empty);
            });
        }
Ejemplo n.º 2
0
        public HttpResponseMessage CaptureProgress()
        {
            var perco    = new Percolator(ApplicationContext.ApplicationCache.RuntimeCache);
            var progress = perco.CaptureProgress();

            // progres.DateTime is 'now' as local datetime
            // round to next 12hrs
            // so will be 12:00:00 or 00:00:00, server time
            // (everything we do is server-local time based)

            var captureDateTime = progress.DateTime.Date;

            captureDateTime = progress.DateTime.Hour < 12
                ? captureDateTime.AddHours(12)
                : captureDateTime.AddDays(1);
            progress.DateTime = captureDateTime;

            SprintProgress.Save(progress);

            return(Request.CreateResponse(HttpStatusCode.OK, captureDateTime.ToUniversalTime()));
        }
Ejemplo n.º 3
0
        public override bool PerformRun()
        {
            var perco    = new Percolator(ApplicationContext.Current.ApplicationCache.RuntimeCache);
            var progress = perco.CaptureProgress(); // fixme - this should be async

            // progres.DateTime is 'now' as local datetime
            // round to next 12hrs
            // so will be 12:00:00 or 00:00:00, server time
            // (everything we do is server-local time based)

            var captureDateTime = progress.DateTime.Date;

            captureDateTime = progress.DateTime.Hour < 12
                ? captureDateTime.AddHours(12)
                : captureDateTime.AddDays(1);
            progress.DateTime = captureDateTime;

            SprintProgress.Save(progress);

            Logger.Info <CaptureProgress>($"Capture Progress {captureDateTime}.");

            // repeat
            return(true);
        }