My goal is preserve the same “jobId” for periodic execution AND make sure tasks of the same “jobId” never overlap. So we can have a nice persistent looking dashboard and don’t crash.
The only HangFire job type that allows specifying “jobId” is recurring job and those are “fire-and-forget”, in other words – if a 1 minute interval job takes 2 minutes to complete than we end up with a growing queue of job executions (and eventually crash) as the recurring job runs before it’s previous cycle completes.
[DisableConcurrentExecution] attribute can prevent overlap but it doesn’t discriminate which “jobId” tries to execute – no job but one gets into the method and we severely limit the throughput.
Finally, the trick of re-enqueuing as BackgroundJob.Schedule. This could work – BUT there’s no way to specify the “jobId” so now DashBoard is much less useful.
It’s a real deal breaker for us, sadly. Is there some sort of workaround or an extension out there to help?