I’ve discovered hang fire few month ago. I’ve wanted to check how hangfire works but I do not want to install/deploy an SQL Server or something else. The overview and dashboard screenshots are really good. I was sad to do not quickly see it, again and again with 1.3, 1.4 and now 1.42 version !
So, I’ve read how SQL Server, MongDB and others storage was implemented. And even if it is not easy than creating a job, it’s not a big deal.
I’ve tried to create a quick and easy storage which contains everything in memory.
After some tests, it seems to work with any job and the dashboard.
Looking to use MemoryStorage as BackgroundJob.Enqueue was persisting a a new job each time the app starts and I need the job to go away on app shutdown. Resorting to this as I did not see a way to purge old job.
Additionally there are two MemoryStorageOptions for which I find no documentation. If you could please point me to any documentation on these options CountersAggregateInterval and JobExpirationCheckInterval.
Hey @perrich, listen I’ve found a bug maybe? I was using hangfire with sqllite and when switched to your storage i got some unit test failing because the job history list was sorted the other way arround. I dont know if its sql lite storage or yours the prob.
I’ve fixed it with this:
_stateHistoryDto = jobDetailsDto.History.OrderByDescending(x => x.CreatedAt).First();
the old code had no sorting after the history property