在启用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(); } }
能否问下是否是哪里的配置不对导致的?