Job still running after Deleting (.NET core)

I’m adding a job via .NET core using:

var id = BackgroundJob.Enqueue(() => migrationEngine.MigrateFarm(request, JobCancellationToken.Null));

If I delete it via the dashboard, it all appears to be deleted in the database etc, but the job continues to run. Do you have any pointers to why this could be happening? The weird thing is this used to work. I’ve upgraded to hangfire version 1.6.20, but still doing the same thing.

Many thanks

did you find out how to stop running it?

To handle properly this case you need to support CancellationToken or JobCancellationToken in your job method. Of course it is not enough to pass the CancellationToken parameter but it also need you code to use it and exit when the CancellationToken is cancelled.

More info here: Using Cancellation Tokens — Hangfire Documentation