I am currently working on EmailNotification module in which i have started using hangfire. The only issue is after trying 10 times, if hangfire fails to (schedule job) email in my case, there is not way i can find to get updates regarding that via code.
I know of the fact, i can access hangfire - dashboard by configuring hangfire as below:
public void ConfigureHangfire(IAppBuilder app)
{
var container = AutofacConfig.RegisterBackgroundJobComponents();
var sqlOptions = new SqlServerStorageOptions
{
PrepareSchemaIfNecessary = Config.CreateHangfireSchema
};
Hangfire.GlobalConfiguration.Configuration.UseSqlServerStorage("hangfire", sqlOptions);
Hangfire.GlobalConfiguration.Configuration.UseAutofacActivator(container);
var options = new BackgroundJobServerOptions() {Queues = new[] {"emails"}};
app.UseHangfireDashboard();
app.UseHangfireServer(options);
}
But the issue is i am not able to find a way to access failed job programmatically. I wonder if anyone has come across this issue, would like to know details.