-
Notifications
You must be signed in to change notification settings - Fork 179
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
ignore_exc should return default values #350
Comments
jogo
added a commit
to jogo/pymemcache
that referenced
this issue
Sep 22, 2021
ignore_exc should treat an error as a cache miss and default specifies what should be returned on a miss. Fixes issue pinterest#350
Thank you for the bug report, #351 should address this |
Pankrat
added a commit
to Pankrat/pymemcache
that referenced
this issue
Oct 4, 2021
When using `HashClient` with `ignore_exc`, `get` would always return `None` if no server is available. The other clients return the default value in this case. Return the default value so `HashClient` behaves like the other clients. Fixes a variation of issue pinterest#350
Pankrat
pushed a commit
to Pankrat/pymemcache
that referenced
this issue
Oct 5, 2021
ignore_exc should treat an error as a cache miss and default specifies what should be returned on a miss. Fixes issue pinterest#350
Pankrat
added a commit
to Pankrat/pymemcache
that referenced
this issue
Oct 7, 2021
When using `HashClient` with `ignore_exc`, `get` would always return `None` if no server is available and the default is passed as a positional argument. The other clients return the default value in this case. An earlier fix only had the desired effect when passing `default` as a keyword argument. Return the default value so `HashClient` behaves like the other clients even when using Fixes another variation of issue pinterest#350
Pankrat
added a commit
to Pankrat/pymemcache
that referenced
this issue
Oct 7, 2021
When using `HashClient` with `ignore_exc`, `get` would always return `None` if no server is available and the default is passed as a positional argument. The other clients return the default value in this case. An earlier fix only had the desired effect when passing `default` as a keyword argument. Return the default value so `HashClient` behaves like the other clients even when using Fixes another variation of issue pinterest#350
Pankrat
added a commit
to Pankrat/pymemcache
that referenced
this issue
Oct 14, 2021
When using `HashClient` with `ignore_exc`, `get` would always return `None` if no server is available and the default is passed as a positional argument. The other clients return the default value in this case. An earlier fix only had the desired effect when passing `default` as a keyword argument. Return the default value so `HashClient` behaves like the other clients even when using Fixes another variation of issue pinterest#350
jparise
pushed a commit
that referenced
this issue
Feb 20, 2022
ignore_exc should treat an error as a cache miss and default specifies what should be returned on a miss. Fixes issue #350
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Its better for ignore_exc to use default value on return, instead of None. It will be real missing cache behaviour and will help with errors when default expected. For example:
Django==3.2
djangorestframework==3.11.1
pymemcache==3.5.0
rest_framework.throttling module
This code with in Django with PyMemcacheCache cache backend and ignore_exc option leads to an error
object of type 'NoneType' has no len()
because instead of returning list as missing cache result, it returns None.The text was updated successfully, but these errors were encountered: