79780812

Date: 2025-10-02 10:29:44
Score: 1.5
Natty:
Report link

This behaviour is actually documented in https://github.com/HangfireIO/Hangfire.InMemory?tab=readme-ov-file#maximum-expiration-time

Specifying the InMemoryStorageOptions fixed the problem. In my case:

builder.Services.AddHangfire(configuration => configuration
    .SetDataCompatibilityLevel(CompatibilityLevel.Version_180)
    .UseSimpleAssemblyNameTypeSerializer()
    .UseRecommendedSerializerSettings()
    .UseInMemoryStorage(new InMemoryStorageOptions { MaxExpirationTime = null })
    .WithJobExpirationTimeout(TimeSpan.FromDays(60))
);
Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: user27465760