Killing Jobs & Monitoring Jobs

Facility to kill a job based on a request from an external application. I have signalr app working under hangfire. I want to stop the execution by calling signalr stop which succeeds yet job doesn’t exit i have very long process of items working along , I wanted to mark a job complete. To end the job gracefully at least so i don’t need to wait till the job succeeds or ends.

Next one would be running a job which monitors and reports back return data from each task. I have checked the Return value of jobs. This will be helpful to update the status across large group of listening jobs which would execute based on the reply.

Hope i have clearly explained my request.

Regarding the first request, when you create a job the job ID is returned. There is a method BackgroundJob.Delete(string jobId) which will change the job to the DeletedState and this sounds more suitable than changing it to Succeeded or Failed.

Regarding the second, I’m not sure what you are actually asking for. The thread / pull request that you linked to appears to do what you need ?

1 Like