-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] FailSafe seems to ignore Duration when enabled #115
Comments
Hi @suhrab and thanks for using FusionCache! You kind of have a point here but the thing is more nuanced, let me quickly explain. In the Options docs you can see that it says this about And about So the thing is this: When NOT USING fail-safe, When USING fail-safe instead, the actual cache entry physical expiration is the Now the problem here is what happens when the user (you in this case) specifies that the Now, how can we make this better? I think there are 2 ways to handle this:
I would go with the 2nd option, but I'd like to know what you think about all of this. Let me know! |
PS: there's a new version (v0.19.0) coming out this weekend so, if you are quick to answer, this change may go directly into it 😉 |
Hi @suhrab , I've implemented the 2nd option thanks to some additional checks and a normalization, and it seems to work very well. As said it is also logging in case a normalization occurs, and the default logging level in case of options normalization is Of course that can be changed thanks to a new I've also added some tests of course to verify the correct behavior and avoid future regressions. I think I'll release the new version between today and tomorrow. Hope this helps. |
The new v0.19.0 has been released, which includes this 🎉 |
Hey Jody. I like more the option 2 you did. "the higher of the 2" is good. Great news. Have fun with your project. You are very friendly and helpful. Good job! |
Describe the bug
When FailSafe is enabled it seems that Duration is ignored. Method GetOrSetAsync(). Please check out gist link below
IsFailSafeEnabled=true
Duration=1hour
FailSafeMaxDuration=10seconds
FailSafeThrottleDuration=5seconds
The cached item expires in 10 seconds. Though Duration is 1hour. And cache factory does not throw
To Reproduce
https://gist.github.com/suhrab/dab0a8081066cb51b130c744d93b4a86
"cacheFactoryGood fired" will be printed to Console 3 times. Though only single time expected - Duration is 1hours
I've encountered this issue on
The text was updated successfully, but these errors were encountered: