Hangfire
Hangfire copied to clipboard
Hangfire cancels semi-long running job and re-starts it again
We're using the latest (1.7.24) version of Hangfire together with its MS SQL storage functionality and during debugging (and sitting on a breakpoint for a little while and then hitting continue), I've several times that the originally started job gets cancelled by the CancellationToken passed in via Hangfire and restarted.
Why is this happening and how do I change that from happening? All our jobs -will- take longer than the amount of time I've sat on that breakpoints (which may have been somewhere between 10 - 30 minutes?) and I would like to change or disable that default behavior but it is unclear to me why this is happening.
Any hints or guidance how to change this would be greatly appreciated.
Reading on another issue relating to cancellation I noticed mention of there being a 'watcher' that runs in background and how there is a 'JobInvisibilityTimeout' that may be in play here. I'm guessing here, but that may need to be set to a more generous time than the default if you're having long-running jobs. I'm not really familiar with how that setting is leveraged but it sounds like it may be related at least.