示例#1
0
        /// <summary>
        /// 移除异常信息
        /// 因为只能在IJob持久化操作JobDataMap,所有这里直接暴力操作数据库。
        /// </summary>
        /// <param name="jobGroup"></param>
        /// <param name="jobName"></param>
        /// <returns></returns>
        public async Task <bool> RemoveErrLog(string jobGroup, string jobName)
        {
            IRepositorie logRepositorie = RepositorieFactory.CreateRepositorie(driverDelegateType, dbProvider);

            if (logRepositorie == null)
            {
                return(false);
            }

            await logRepositorie.RemoveErrLogAsync(jobGroup, jobName);

            var jobKey    = new JobKey(jobName, jobGroup);
            var jobDetail = await scheduler.GetJobDetail(jobKey);

            jobDetail.JobDataMap[Constant.EXCEPTION] = string.Empty;

            return(true);
        }