Long-Running jobs

Tags: #<Tag:0x00007f185fc3df38>

We use Hangfire 1.6.17 for running our background jobs 1 by 1 for our SQL/.net app, a job that was submitted recently wasn’t invalid but had junk data and ran for hours it looks like however that hangfire was realising and restarting it, but the job just went back to grinding along holding everything else in the queue.

I’ve tried going through the documentation but its too much for the (support person) brain

So my questions are

  • How do we define the maximum run-time for job (I understand it has a 30min default but could find it defined in the code)
  • How can we make it drop the job instead of retry?
  • How can we make it trigger some code (or stored procedure) on job-drop (to let our application know the job may be bad)

Thanks for your help.