How to modify wokercount or enable and remove recurring jobs without downtime

I’m using:

  • Hangfire.AspNetCore
  • Hangfire.Autofac
  • FaceIT.Hangfire.Tags.Redis.StackExchange

I have some long-running, resource-intensive tasks. Therefore, I need to:

  1. Dynamically adjust the WorkerCount based on system load.
  2. Stop or pause certain jobs in emergency situations.

Is there an official way to achieve this with Hangfire?

I would be really happy to hear from you guys.

A list of the jobs can be retrieved with the JobStorage.Current.GetMonitoringApi(). They can be deleted, but you probably need to add CancellationToken to the method, otherwise the job will be deleted from the queue, but the method will continue running.