Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hangfire configuration - how often it pings the database

Tags:

hangfire

It looks like Hangfire hits the database few times a second, probably to find out if there are any jobs to pick up. I would like to slow it down as I don't mind if the checks are done every few seconds.

Is it possible?

Hangfire 1.6 docs say:

The usage is simple, just include Hangfire namespace in your application initialization class and discover extension methods for the GlobalConfiguration.Configuration property.

I cannot find anything that would help me here :(

like image 589
tymtam Avatar asked Oct 19 '25 01:10

tymtam


1 Answers

Look at this : 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);

like image 104
Whiletrue Avatar answered Oct 22 '25 05:10

Whiletrue



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!