1、更新Hangfire版本到1.7.0,才支持使用按秒循环任务执行RecurringJob.AddOrUpdate("test",()=>writeLog("每20秒执行任务"), "*/20 * * * * *");2、修改参数var jobOptions = new BackgroundJobServerOptions
{
Queues = new[] { "critical", "test", "default" },
WorkerCount = Environment.ProcessorCount * int.Parse(Configuration["Hangfire:ProcessorCount"]),
ServerName = Configuration["Hangfire:ServerName"],
SchedulePollingInterval = TimeSpan.FromSeconds(1), //计划轮询间隔 支持任务到秒
};