Hangfire keeps stopping randomly

Hangfire api keeps stopping randomly how do I prevent this. I have provided all the app settings with no idle timeout and startmode. Is there a way to resolve this ?

Hard to say, lacking context.

If you’re using an ASP.NET site as your Hangfire host, and it’s hosted in IIS, then no matter how you figure HF or the site, IIS will suspend the site at some point, from lack of activity.

Hi

It stopped randomly at 3 am sometimes at 2 am and then 7 pm.

Do you know how I can resolve this ?

If you’re hosting it inside an ASP.NET site, then you need to implement some sort of “keep alive” process. Basically, you need something to ping the site on a predetermined interval. That will keep IIS from stopping the site.

You can do this as a CRON (recurring) job.

If you’re not hosting the background client in ASP.NET, then you need to provide more details.

I agree. It sounds like and IIS issue. By default, IIS will recycle the app pool every 29 hours. While it “restarts”, it doesn’t really restart until a request comes to IIS. There are setting you can adjust in IIS to get it to fully restart and to control when it does that restart if you want to allow that.

This link is a big help.