alastairtree / LazyCache

An easy to use thread safe in-memory caching service with a simple developer friendly API for c#
https://nuget.org/packages/LazyCache
MIT License
1.72k stars 159 forks source link

Fix setting relative absolute expiration with GetOrAdd #85

Closed Sinhk closed 4 years ago

Sinhk commented 5 years ago

fixes #84

smithybc commented 5 years ago

I noticed this wasn't working also. Is this going to be merged anytime soon?

ddanielorlano commented 5 years ago

Hi, I am experiencing the same issue and was wondering why the 10 seconds wasn't being honored with this registration in startup. services.AddScoped(sp => new MemoryCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromSeconds(10)));

This was working with IMemoryCache, and stopped when switching to LazyCache

alastairtree commented 4 years ago

Thank you for this, it was merged in #125. Sorry for the delay.