Hangfire.InMemory icon indicating copy to clipboard operation
Hangfire.InMemory copied to clipboard

Add retention days

Open ChengYen-Tang opened this issue 3 years ago • 2 comments

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.

ChengYen-Tang avatar Aug 12 '21 09:08 ChengYen-Tang

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));

odinserj avatar Aug 12 '21 11:08 odinserj

Does it work when job are on failed state? Because it doesn't seems so.

DaRochaRomain avatar Jun 02 '22 07:06 DaRochaRomain