Beispiel #1
0
        public string DoScheduledRollback(Guid UpdateInstructionID, Guid RollbackUpdateBackupID)
        {
            var       UpdateInstruction = _UpdateRepository.GetUpdateInstructionByID(UpdateInstructionID);
            JobStatus CurrentJobStatus  = this._JobService.GetQueuePosition(new Domain.Models.Job.JobStatus()
            {
                ID = UpdateInstruction.ID
            });

            if (!string.IsNullOrEmpty(CurrentJobStatus.QueuePosition))
            {
                return(CurrentJobStatus.QueuePosition);
            }

            CurrentJobStatus.ID            = UpdateInstruction.ID;
            CurrentJobStatus.QueuePosition = BackgroundJob.Enqueue(() => this.DoRollback(UpdateInstructionID, RollbackUpdateBackupID));

            this._JobService.CreateUpdateJobStatus(CurrentJobStatus);
            return(CurrentJobStatus.QueuePosition);
        }