Пример #1
0
        public async Task <IResponseEntity> ResumeJob(string jobId)
        {
            var job = await _SysTaskQzService.GetSysTaskQzEntity(jobId);

            var res = await _schedulerCenter.ResumeJob(job);

            return(res);
        }
Пример #2
0
        public async Task <MessageModel <string> > ResumeJob(int jobId)
        {
            var data = new MessageModel <string>();

            var model = await _tasksQzServices.QueryById(jobId);

            if (model != null)
            {
                _unitOfWork.BeginTran();
                try
                {
                    model.IsStart = true;
                    data.success  = await _tasksQzServices.Update(model);

                    data.response = jobId.ObjToString();
                    if (data.success)
                    {
                        data.msg = "更新成功";
                        var ResuleModel = await _schedulerCenter.ResumeJob(model);

                        if (ResuleModel.success)
                        {
                            data.msg = $"{data.msg}=>恢复成功=>{ResuleModel.msg}";
                        }
                        else
                        {
                            data.msg = $"{data.msg}=>恢复失败=>{ResuleModel.msg}";
                        }
                        data.success = ResuleModel.success;
                    }
                    else
                    {
                        data.msg = "更新失败";
                    }
                }
                catch (Exception)
                {
                    throw;
                }
                finally
                {
                    if (data.success)
                    {
                        _unitOfWork.CommitTran();
                    }
                    else
                    {
                        _unitOfWork.RollbackTran();
                    }
                }
            }
            else
            {
                data.msg = "任务不存在";
            }
            return(data);
        }
Пример #3
0
        public async Task <JobResuleModel> ReCoveryJob(Guid Id)
        {
            var model = await _scheduleRepositoty.FirstOrDefaultAsync(x => x.Id == Id);

            var ResuleModel = await _schedulerCenter.ResumeJob(model);

            if (ResuleModel.IsSuccess)
            {
                model.IsStart = true;
            }
            await UpdateScheduleAsync(model);

            return(ResuleModel);
        }
Пример #4
0
        public async Task <MessageModel <string> > ReCovery(int jobId)
        {
            var data = new MessageModel <string>();

            var model = await _tasksQzServices.QueryById(jobId);

            var ResuleModel = await _schedulerCenter.ResumeJob(model);

            if (ResuleModel.success)
            {
                model.IsStart = true;
                data.success  = await _tasksQzServices.Update(model);
            }
            if (data.success)
            {
                data.msg      = "重启成功";
                data.response = jobId.ObjToString();
            }
            return(data);
        }