private void StartJob(JobBase job) { try { JobBase detailJobInfo = LoadDetailJobInfo(job.JobID, job.JobType); detailJobInfo.Start(); } catch (ThreadAbortException) { } catch (Exception ex) { WriteJobException(job, this.Params.Log, "执行", ex); } finally { job.SetCurrentJobEndStatus(); string logDetail = string.Format("定时任务[{0},{1}]在[{2}]时执行]", job.Name, job.JobType.ToString(), DateTime.Now.ToString()); UserOperationLog log = new UserOperationLog() { ResourceID = job.JobID, OperationDateTime = DateTime.Now, Subject = "定时任务执行", OperationName = job.Name, OperationDescription = logDetail }; UserOperationLogAdapter.Instance.Update(log); } }
private void StartJob(JobBase job) { try { JobBase detailJobInfo = LoadDetailJobInfo(job.JobID, job.JobType); detailJobInfo.Start(); } catch (ThreadAbortException) { } catch (Exception ex) { WriteJobException(job, this.Params.Log, "执行", ex); } finally { job.SetCurrentJobEndStatus(); string logDetail = string.Format("定时任务[{0},{1}]在[{2}]时执行]", job.Name, job.JobType.ToString(), DateTime.Now.ToString()); UserOperationLog log = new UserOperationLog() { ResourceID = job.JobID, OperationDateTime = DateTime.Now, Subject = "定时任务执行", OperationName = job.Name, OperationDescription = logDetail }; UserOperationLogAdapter.Instance.Update(log); } }