在发布 ASP MVC 应用程序后,Hangfire Dashboard 说它没有活动服务器。试图重新启动、重建、删除数据库中的 Hangfire 表 - 没有成功。OWIN 启动类:
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
ConfigureAuth(app);
app.MapSignalR();
GlobalConfiguration.Configuration
.UseSqlServerStorage(@"HangfireStorage");
var options = new BackgroundJobServerOptions
{
Queues = new[] { "critical", "default" }
};
app.UseHangfireServer(options);
app.UseHangfireDashboard("/hangfire", new DashboardOptions
{
AuthorizationFilters = new[] { new MyRestrictiveAuthorizationFilter() }
});
var hangfireUpdatingCron = ConfigurationManager.AppSettings["HangfireUpdatingPlayersCron"];
var hangfireUpdatingLeagueMatchesCron = ConfigurationManager.AppSettings["HangfireUpdatingLeagueMatchesCron"];
BackgroundJob.Enqueue(() => SteamParser.ResetAllUpdatings());
BackgroundJob.Enqueue(() => SteamParser.UpdateAllPlayers());
RecurringJob.AddOrUpdate(() => SteamParser.UpdateAllPlayers(), hangfireUpdatingCron);
RecurringJob.AddOrUpdate(() => SteamParser.UpdateLeagueMatches(), hangfireUpdatingLeagueMatchesCron);
}
}