Query Hangfire via internal API or Db Context?

771 Views Asked by At

I wonder if there is an internal API or EF Context that i can use within hangfire? I would like to obtain a list of all the jobs that have failed, check the method they are for and then requeue them if they are for the method i require.

I would like to do this so that users can change the configuration of a job that has been queued but failed for whatever reason, and they can force it to run again.

1

There are 1 best solutions below

0
On BEST ANSWER

You should try with a monitoring API object, obtained through :

Hangfire.JobStorage.Current.GetMonitoringApi()

and its FailedJobs(int from, int count) method