Ejemplo n.º 1
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.º 2
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);
        }