yuzd / Hangfire.HttpJob

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

Hangfire.HttpJob.Support.AgentJobException #83

Closed gywei closed 4 years ago

gywei commented 4 years ago

err:JobClass:Admin.Core.Jobs.UpdateUserLocationJob,Admin.Core can not start, is already Running!

Hangfire.HttpJob.Support.AgentJobException: AgentClass:Admin.Core.Jobs.UpdateUserLocationJob,Admin.Core=>err:JobClass:Admin.Core.Jobs.UpdateUserLocationJob,Admin.Core can not start, is already Running! at Hangfire.HttpJob.Server.HttpJob.Run(HttpJobItem item, PerformContext context, List`1 logList, HttpJobItem parentJob) at Hangfire.HttpJob.Server.HttpJob.Excute(HttpJobItem item, String jobName, String queuename, Boolean isretry, PerformContext context)

这种是什么错误?如何避免这种错误?

yuzd commented 4 years ago

这个错误的意思是, 你的UpdateUserLocationJob 是单例的job 没有运行结束 就重新调度运行 就会出现这个错误。 你可以忽略这个错误,请在全局设置里面配置https://github.com/yuzd/Hangfire.HttpJob/wiki/%E5%85%A8%E5%B1%80%E5%8A%A8%E6%80%81%E9%85%8D%E7%BD%AE%E5%8F%82%E6%95%B0

或者你把你的这个job设置为多例的 请参考https://github.com/yuzd/Hangfire.HttpJob/wiki/03.HttpJob.Agent%E7%BB%84%E4%BB%B6%E4%BB%8B%E7%BB%8D%E4%BB%A5%E5%8F%8A%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8#agentjob-%E5%88%86%E4%B8%8B%E9%9D%A2%E4%B8%A4%E7%A7%8D

gywei commented 4 years ago

非常感谢!