In GetOrAddAsync, addItemFactory is now awaited before SetAbsoluteExpirationFromRelative is called. This eliminates the race condition where SetAbsoluteExpirationFromRelative reads from ICacheEntry.AbsoluteExpirationRelativeToNow before it is set to, in cases where AbsoluteExpirationRelativeToNow is set after a long-running task in the factory completes.
Fixes #148.
GetOrAddAsync
,addItemFactory
is nowawait
ed beforeSetAbsoluteExpirationFromRelative
is called. This eliminates the race condition whereSetAbsoluteExpirationFromRelative
reads fromICacheEntry.AbsoluteExpirationRelativeToNow
before it is set to, in cases whereAbsoluteExpirationRelativeToNow
is set after a long-running task in the factory completes.