You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
var connectionString = configuration.GetValue<string>("Database:ConnectionString");
var connectionFactory = new NpgsqlConnectionFactory(connectionString, new PostgreSqlStorageOptions()
{
PrepareSchemaIfNecessary = true,
UseSlidingInvisibilityTimeout = true,
InvisibilityTimeout = TimeSpan.FromHours(12),
DistributedLockTimeout = TimeSpan.FromHours(12),
});
//JobStorage.Current = new PostgreSqlStorage(connectionFactory);
return services.AddHangfire(config =>
{
config.UsePostgreSqlStorage(options => options.UseConnectionFactory(connectionFactory));
});
Desired situation would be that the job runs to completion (multiple hours of processing needed most of the time).
I'm at a loss.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: