Hangfire配置 - 频繁ping数据库的频率

时间:2016-09-28 02:17:35

标签: hangfire

看起来Hangfire每秒几次点击数据库,可能是为了找出是否有任何工作要拿起来。我想放慢速度,因为我不介意每隔几秒检查一次。

有可能吗?

Hangfire 1.6文档说:

  

用法很简单,只需在应用程序初始化类中包含Hangfire命名空间,并发现GlobalConfiguration.Configuration属性的扩展方法。

我找不到任何可以帮助我的事情:(

1 个答案:

答案 0 :(得分:1)

看看这个:http://docs.hangfire.io/en/latest/configuration/using-sql-server.html#configuring-the-polling-interval

var options = new SqlServerStorageOptions{ QueuePollInterval = TimeSpan.FromSeconds(15) // Default value}; GlobalConfiguration.Configuration.UseSqlServerStorage("<name or connection string>", options);

相关问题