/// <summary> /// 运行一次job /// </summary> /// <param name="name"></param> public void RunOnceNow(string name) { ServiceContainer.ResolveAll <IJob>().Each(item => { var job = item as JobBase; if (job.Name == name) { JobHelpers.RunOnceNow(job.Name, job.GetType().Namespace); } }); }
public void RunOnce(string id) { var data = GetData(id); var paramList = new Dictionary <string, object>() { { "Entity", data }, { "User", UserIdentityUtil.GetAdmin() } }; JobHelpers.RunOnceNow(data.name, data.robotidName, paramList); var jobState = JobHelpers.GetJobStatus(data.name, data.robotidName).ToSelectOption(); data.job_state = jobState.Value.ToString(); data.job_stateName = jobState.Name; UpdateData(data); }