perrich / Hangfire.MemoryStorage

A memory storage for Hangfire.
Apache License 2.0
131 stars 43 forks source link

Increasing process restarts for long jobs? #17

Closed henkealg closed 6 years ago

henkealg commented 6 years ago

Hi, Thanks for a great addition to the Hangfire project. Sorry if this question has come up earlier. I did not find any answer in previous issues. We are having issues with long jobs restarting 30 minute into the process using MemoryStorage. I suppose the FetchNextJobTimeout variable is used to control the timespan for restarts of jobs that seem "stale". Is there a way to increase this limit using a config option?

The project is running .net Core 2 on Ubuntu.

perrich commented 6 years ago

Hi, Yes, it's available using MemoryStorageOptions :

var options = new MemoryStorageOptions();
options.FetchNextJobTimeout = TimeSpan.FromMinutes(60);

GlobalConfiguration.Configuration.UseMemoryStorage(options);
henkealg commented 6 years ago

Changing the options worked as a charm. Thank you for the fast response. 👍 Closing issue.