]> git.ipfire.org Git - ipfire.org.git/commitdiff
memcache: Allow caching None
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 7 May 2019 10:41:32 +0000 (11:41 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 7 May 2019 10:41:32 +0000 (11:41 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/backend/memcached.py

index d7d04b36f730ae2742043e93a7da55283c867b43..f6231aecf4cec796b227593d99e671b259ba6473 100644 (file)
@@ -22,7 +22,10 @@ class Memcached(Object):
                return ret
 
        def set(self, key, data, *args, **kwargs):
-               logging.debug("Putting %s bytes into cache for %s" % (len(data), key))
+               if data is None:
+                       logging.debug("Putting nothing into cache for %s" % key)
+               else:
+                       logging.debug("Putting %s bytes into cache for %s" % (len(data), key))
 
                return self._connection.set(key, data, *args, **kwargs)