/// <summary> 立即执行 </summary>
        /// <param name="jobId"></param>
        /// <returns></returns>
        public async Task TriggerJob(string jobId)
        {
            //立即执行
            var dto = await _jobContract.GetAsync(jobId);

            if (dto == null)
            {
                throw new BusiException("任务不存在");
            }
            var trigger = TriggerBuilder.Create()
                          .WithIdentity($"{IdentityHelper.Guid32}")
                          .StartNow()
                          .Build();

            dto.Id = IdentityHelper.Guid32;
            await RunJob(dto, trigger);
        }
Example #2
0
        public async Task <DResult <JobDto> > QueryJob(string jobId)
        {
            var dto = await _contract.GetAsync(jobId);

            return(DResult.Succ(dto));
        }