yuzd / Hangfire.HttpJob

httpjob for Hangfire,restful api for Hangfire,job调度与业务分离
https://github.com/yuzd/Hangfire.HttpJob/wiki
MIT License
630 stars 186 forks source link

关于JobAgent 中,在运行时抛出的异常问题 #176

Closed andyfoxcs closed 1 year ago

andyfoxcs commented 1 year ago

我通过HttpJob.Client 向hangfire调度中心发起任务,并在任务中的 Fail中填写了返回异常时回调服务这个路径,但是在实际运行时,JobAgent中已经抛出了异常,但是在Fail中并未接收到一次信息

HttpJob.Client中Fail信息截图:

image

调度中心任务状态截图:

image

JobAgent片段代码截图:

image

调度中心日志截图:

image

请问如何返回JobAgent的错误给到Client?

yuzd commented 1 year ago

我今天看下这个问题

yuzd commented 1 year ago

jobagent这种类型的job 区别于传统的webjob有点不一样,没有把返回值给到调度中心 这个要改一下,等我消息

yuzd commented 1 year ago

我想了下,你这个场景其实不需要用jobagent呀,你只需要用普通的webapi即可

jobagent可能需要一直执行的,不存在有返回值一说了 @andyfoxcs

yuzd commented 1 year ago

如果你需要在jobagent执行成功 或者失败 去执行别的 完全可以在jobagent里面自己写一些相对应的逻辑也行的

yuzd commented 1 year ago

我先关闭了