You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The docs say that Hangfire will provide its own CancellationToken as argument. How do I get the CancellationTokenSource for that in order to call Cancel on it?
... Though I'm not sure if that would even be necessary? I'm seeing conflicting information on SO, docs and elsewhere regarding job deletion and cancellation. This SO answer and others I've seen say that deleting a job would trigger its CancellationToken.
However, the documentation for Hangfire.BackgroundJobClientExtensions.Delete say, on its remarks (emphasis mine):
// The job is not actually being deleted, this method changes only its state. This
// operation does not provide guarantee that the job will not be performed. If you
// are deleting a job that is performing right now, it will be performed anyway,
// despite of this call. The method returns result of a state transition. It can
// be false if a job was expired, its method does not exist or there was an exception
// during the state change process.
So I'm confused. Does Hangfire trigger the CancellationToken when requesting a change to the Deleted state or do I need to provide Hangfire with a way to resolve a CancellationTokenSource so that it uses that instead so that I can call Cancel on it myself (some answers on SO say that is the right implementation), or something else...?
it would be nice if you could cancel or pause a job
The text was updated successfully, but these errors were encountered: