I'm not sure what's going on with Hangfire but calling BackgroundJob.Enqueue() adds a job to the database as "Scheduled" but nothing seems to happen. The method code does not seem to run. In the debugger no break points get hit and in my logs from inside job nothing gets printed.
JobStorage.Current = new SqlServerStorage("DefaultConnection");
I had a similar issue. In my case the problem was that my dependency injection wasn't properly wired up.
Only after I went to Hangfire Dashboard -> Scheduled Jobs
and clicked on my job to see more details, I could see the exact exception messages i.e. "Couldn't create interface 'some_interface'".
Check if your jobs are initialised properly and that there are no errors in the 'Scheduled' part of Hangfire Dashboard.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With