-
Notifications
You must be signed in to change notification settings - Fork 178
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
fix django2.0 #179
fix django2.0 #179
Conversation
Looks good, although this does change the behavior of the API so we should make sure to document that in the changelog. but the change behavior is fairly minor and looks reasonable. This doesn't seem to fully implement django's expected behavior of returning a list of failed keys, is that expected? |
hi @jogo PooledClient and Client always return empty list. |
pymemcache/client/hash.py
Outdated
@@ -261,11 +261,11 @@ def set_many(self, values, *args, **kwargs): | |||
new_args.insert(0, values) | |||
result = self._safely_run_func( | |||
client, | |||
client.set_many, False, *new_args, **kwargs | |||
client.set_many, values.keys(), *new_args, **kwargs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this means, if any of these keys fail, we mark all as failed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
That's true. I will fix it.
@jogo any update on this issue? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, one comment
pymemcache/client/base.py
Outdated
or none of the keys have been successfully set. If noreply is True | ||
then a successful return does not guarantee that any keys were | ||
successfully set (just that the keys were successfully sent). | ||
Empty list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't this now return a list of failed sets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx! i fixed it.
pls restart job |
Job has been restarted |
Thanks looks good. Will work on releasing this sometime next week as a major version bump. |
@jogo |
@jogo When release it? |
Failed
set_many
with django2.0.Release Note: https://docs.djangoproject.com/en/2.0/releases/2.0/#cache
Code: https://github.com/django/django/blob/338f741c5eb6b91118f6a6b7c34b5e9b47a5661d/django/core/cache/backends/memcached.py#L131-L139
Since django 2.0, the return value of set_many now expects a list of keys of failed objects in store.
It should be implemented at the cache backend, but python-memcached and pylibmc return list objects, so I tried it accordingly.