I have developed a .NET application using .NET 8 and the following packages:
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.11" />
<PackageReference Include="Hangfire.MemoryStorage" Version="1.8.0" />
<PackageReference Include="Hangfire.Dashboard.BasicAuthorization" Version="1.0.2" />
My goal is to manage recurring jobs through Hangfire. I have made the necessary configuration as shown below, and I am calling the recurring functions as follows. I am not experiencing any issues in my local environment. However, when I dockerize the application and deploy it to Kubernetes, I get an error saying “No newly aborted jobs found.”
Could you please assist me with this issue?
Here is my configuration and the function calls:
// config
builder.Services.AddHangfire(x => x.UseMemoryStorage());
builder.Services.AddHangfireServer();
// function Call
RecurringJob.AddOrUpdate(nameof(AppParameter), () => appParameter.CleanupExpiredRecords(), Cron.Hourly);
RecurringJob.AddOrUpdate(nameof(AppUser), () => appUser.CleanupExpiredRecords(), Cron.Hourly());
RecurringJob.AddOrUpdate(nameof(AppRole), () => appRole.CleanupExpiredRecords(), Cron.Hourly());
RecurringJob.AddOrUpdate(nameof(AppUserRole), () => appUserRole.CleanupExpiredRecords(), Cron.Hourly);
Deniz EFE is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.