Open r-bennett opened 3 years ago
Yeah I think the line https://github.com/alastairtree/LazyCache/blob/33d055c75b455eacf62add2ca41182b541b47981/LazyCache/CachingService.cs#L184 which is currently
return GetOrAddAsync(key, addItemFactory, null);
should be
return cache.GetOrAddAsync(key, addItemFactory, cache.DefaultCachePolicy.BuildOptions());
Could you submit a failing test like your example and a PR to fix please?
@alastairtree can you merge this PR#190 and update the version to support dotnet 7?
Describe the bug DefaultCacheDurationSeconds is being ignored in some code paths. It only appears to be used in
AppCacheExtensions
e.g. extension https://github.com/alastairtree/LazyCache/blob/e38695bf63b1d33d97032e995d7dd5609dd692b3/LazyCache/AppCacheExtensions.cs#L74 but not in the almost equivalent instance method https://github.com/alastairtree/LazyCache/blob/33d055c75b455eacf62add2ca41182b541b47981/LazyCache/CachingService.cs#L182To Reproduce
Expected behavior A new value generated for each call, with output e.g.
Actual behavior Same value reused for
"foo"
, with output e.g.Framework and Platform
Additional context Similar to the report in https://github.com/alastairtree/LazyCache/issues/121, although this isn't because of lazy eviction