Ejemplo n.º 1
0
        public ActionResult Resume(string id)
        {

            var dto = _logApp.GetModel(id.Trim());
            if (dto == null)
            {
                return Error("任务启动失败");
            }
            IJob job = ReflectionHelper.Instance<IJob>(dto.assembly_namespace.Trim(), dto.class_name.Trim());
            RecurringJob.AddOrUpdate(id,
                   () => job.Excute(_wxSetting.WeixinAppId, dto.id), dto.cron_express,TimeZoneInfo.Local);
            _logApp.Resume(dto.id);
            return Success("任务启动成功");
        }
Ejemplo n.º 2
0
        public ActionResult Resume(string id)
        {
            var dto = _logApp.GetModel(id.Trim());

            if (dto == null)
            {
                return(Error("任务启动失败"));
            }
            IJob job = ReflectionHelper.Instance <IJob>(dto.assembly_namespace.Trim(), dto.class_name.Trim());
            Dictionary <string, string> jobParams = new Dictionary <string, string>();

            jobParams.Add("jobId", dto.id);
            RecurringJob.AddOrUpdate(id, () => job.Excute(jobParams), dto.cron_express, TimeZoneInfo.Local);
            _logApp.Resume(dto.id);
            return(Success("任务启动成功"));
        }