我目前正在开发使用hangfire的EmailNotification模块.唯一的问题是在尝试10次之后,如果在我的情况下hangfire未能(安排工作)电子邮件,我无法找到通过代码获得有关的更新.
我知道这个事实,我可以通过配置hangfire来访问hangfire - dashboard,如下所示:
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);
}
Run Code Online (Sandbox Code Playgroud)
但问题是我无法找到以编程方式访问失败作业的方法.我想知道是否有人遇到过这个问题,想知道细节.