首页 新闻 会员 周边

程序停止了,hangfire的管理后台还在运行定时任务

0
悬赏园豆:10 [已关闭问题] 关闭于 2018-05-17 15:28

在启用hangfire的服务端的时候,当我把客户的应用关闭了的时候,登录服务端去查看正在运行的定期作业,发现刚刚被我关闭的任务在管理后台上显示还在正常运行,可是我已经把程序关闭了。

using (var server = new BackgroundJobServer())
            {
               // BackgroundJob.Enqueue(() => ConsoleWhile());
                RecurringJob.AddOrUpdate(() => Class1.NameTest(), Cron.Minutely);
                //for (int i = 0; i < 100; i++)
                //{
                //    BackgroundJob.Enqueue(() => ConsoleWhile());
                //}
                Console.WriteLine("Hangfire Server started. Press any key to exit...");
                Console.ReadKey();
            }
客户端代码
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            GlobalConfiguration.Configuration
                .UseSqlServerStorage("xxxx");

            app.UseHangfireDashboard();
            app.UseHangfireServer();
        }
    }
服务端代码

能否问下是否是哪里的配置不对导致的?

yjq_net的主页 yjq_net | 初学一级 | 园豆:2
提问于:2017-06-27 23:06
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册