Ticket #27318: 0001-Fixed-27318-Return-list-of-failing-keys-with-set_man.patch

File 0001-Fixed-27318-Return-list-of-failing-keys-with-set_man.patch, 1.2 KB (added by Florent Fourcot, 8 years ago)
  • django/core/cache/backends/memcached.py

    From 512e17b41e54b4544fbffcbf03cd2e47393000e4 Mon Sep 17 00:00:00 2001
    From: Florent Fourcot <florent.fourcot@wifirst.fr>
    Date: Thu, 6 Oct 2016 15:07:45 +0200
    Subject: [PATCH] Fixed #27318 -- Return list of failing keys with set_many()
    
    Both python-memcached and pylibmc return the list of failing keys, but
    we (previously) not give this list to the caller.
    
    Signed-off-by: Florent Fourcot <florent.fourcot@wifirst.fr>
    ---
     django/core/cache/backends/memcached.py | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/django/core/cache/backends/memcached.py b/django/core/cache/backends/memcached.py
    index 4cf25fb..330afdc 100644
    a b class BaseMemcachedCache(BaseCache):  
    147147        for key, value in data.items():
    148148            key = self.make_key(key, version=version)
    149149            safe_data[key] = value
    150         self._cache.set_multi(safe_data, self.get_backend_timeout(timeout))
     150        # return the list of failing keys
     151        return self._cache.set_multi(safe_data, self.get_backend_timeout(timeout))
    151152
    152153    def delete_many(self, keys, version=None):
    153154        self._cache.delete_multi(self.make_key(key, version=version) for key in keys)
Back to Top