优化任务添加修改&fix手动执行网络型任务失败

This commit is contained in:
不做码农
2022-07-09 14:18:42 +08:00
parent 9394f98682
commit 68faa22ec5
6 changed files with 58 additions and 43 deletions

View File

@@ -46,7 +46,7 @@ namespace ZR.Tasks
RefireImmediately = true
};
status = 1;
logMsg = $"FailException{ex.Message}";
logMsg = $"Job Run FailException{ex.Message}";
}
var logModel = new SysTasksLog()

View File

@@ -29,7 +29,7 @@ namespace ZR.Tasks.TaskScheduler
public async Task Run(IJobExecutionContext context)
{
AbstractTrigger trigger = (context as JobExecutionContextImpl).Trigger as AbstractTrigger;
var info = await tasksQzService.GetByIdAsync(trigger.Name);
var info = await tasksQzService.GetByIdAsync(trigger.JobName);
if (info != null)
{
var result = await HttpHelper.HttpGetAsync("http://" + info.ApiUrl);
@@ -37,7 +37,7 @@ namespace ZR.Tasks.TaskScheduler
}
else
{
throw new CustomException("任务网络请求执行失败,任务不存在");
throw new CustomException($"任务{trigger?.JobName}网络请求执行失败,任务不存在");
}
}
}