2

ASP MVC アプリケーションを発行した後、Hangfire ダッシュボードに、アクティブなサーバーがないと表示されます。DB で 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);
        }
    }
4

3 に答える 3

1

これは私に役立ちました: OWIN Startup クラスで、ServerName を使用して BackgroundJobServerOptions を追加しました。

var options = new BackgroundJobServerOptions
            {
                Queues = new[] { "critical", "default" },
                 ServerName = "Hangfire:1"
            };
于 2015-06-24T18:55:40.463 に答える