Hangfire.InMemory
Hangfire.InMemory copied to clipboard
Add retention days
Increasing data indefinitely may cause the memory space to run out. The project I am developing requires strict memory management. So I think need add retention days in InMemoryStorageOptions.
Thank you.
I'll definitely add this option in future to override the default settings that are more suitable for persistent storages, but meanwhile you can use the WithJobExpirationTimeout
method called directly after the UseInMemoryStorage
in the configuration block:
.UseInMemoryStorage()
.WithJobExpirationTimeout(TimeSpan.FromHours(1));
Does it work when job are on failed state? Because it doesn't seems so.