Reoccurring Job - Wait for job to finish then en-queue itself

I have several jobs that have varying completion times, and thus become difficult to set on a regular schedule. I simply want the job to keep repeating itself only after the job completes. (fails or success or otherwise)

I know there are ways to stop concurrent running, but that’s not the solution I want. Currently I have the job en-queue itself as the last statement (within try/catch). This works, but with the caveat of having to write the job taking into account all possible ways it could fail, and making sure i re-queue it before exiting. Second, is that if you schedule it for say 30 seconds after the current one finishes, that 30 seconds is added to the run time of the current - which shouldn’t be the case.

Is there a way to do this differently?

How so? If the job exits (i.e. switches into Succeeded or Failed state), its execution time is recorded the moment its state has changed, and can’t be changed in the future. I don’t see how scheduling the next job to run, say, in 30 seconds can affect execution time.

You can also use ContinueWith, so the continuation will wait the current job finish before running.

How is that you have to take into account all possible ways it could fail? If you simply have a try/finally around your whole job, then you’re ensured that your code in finally is called no matter what happens in your try.

Its the same pattern used when doing a using() on a IDisposable where the compiler effectlively makes a try/finally to ensure that Dispose() is called no matter what.