I have a long running process, that over time could exceed its recurrence time frame. I looked at the automated retry attribute, but I would prefer to have the jobs not queueing up behind each other.
For the time being I placed a lock(object){} in my code to prevent concurrency issues. I would like to solve the issue of these jobs queuing up behind each other.
[AutomaticRetry(Attempts = 1, OnAttemptsExceeded = AttemptsExceededAction.Fail)]
Doesn’t quite do the job I expect plus it marks the Job as Failed and so reporting would be off because the job wasn’t a failure, its state would be more appropriate to call Deferred or Aborted. I am assuming that Hangfire does not have these concepts for job states as I was not able to find anything that appeared to be equivalent to this.
NOTE: I am a bit new to actually working with Automated Jobs, Background Jobs, Worker Jobs, Ect. So maybe I am just going in the wrong direction.