Open MrMM1981 opened 3 months ago
Fixed it by using config.UsePostgreSqlStorage(options => options.UseConnectionFactory(connectionFactory), new PostgreSqlStorageOptions() { PrepareSchemaIfNecessary = true, UseSlidingInvisibilityTimeout = true, InvisibilityTimeout = TimeSpan.FromHours(12), DistributedLockTimeout = TimeSpan.FromHours(12), }); });
when using
... return services.AddHangfire(config => { config.UsePostgreSqlStorage(options => options.UseConnectionFactory(connectionFactory)); }); the storage options are not respected.
I am running a .NET 8 application with
Hangfire.Core version 1.8.14 Hangfire.AspNetCore version 1.8.14 Hangfire.PostgreSql version 1.20.9
The job is scheduled as expected with background job.enqueue method, it shows up in the dashboard under processing jobs. This job can have a processing duration of multiple hours. What happens is that every 30 minutes a new worker is created and the job is never finished.
I know that the hangfire server keeps running (I see the heartbeat in the logs).
I am using the following configuration for the service.
Desired situation would be that the job runs to completion (multiple hours of processing needed most of the time). I'm at a loss.