Commit 51a3843f authored by Jannis Leidel's avatar Jannis Leidel Committed by Sean Bleier

Another minor change to only call mset if there are actual keys to set.

parent 7fcb542a
...@@ -141,8 +141,9 @@ class CacheClass(BaseCache): ...@@ -141,8 +141,9 @@ class CacheClass(BaseCache):
for key, value in data.iteritems(): for key, value in data.iteritems():
safe_data[self.prepare_key(key)] = base64.encodestring( safe_data[self.prepare_key(key)] = base64.encodestring(
pickle.dumps(value, pickle.HIGHEST_PROTOCOL)).strip() pickle.dumps(value, pickle.HIGHEST_PROTOCOL)).strip()
self._cache.mset(safe_data) if safe_data:
map(self.expire, safe_data, [timeout]*len(safe_data)) self._cache.mset(safe_data)
map(self.expire, safe_data, [timeout]*len(safe_data))
def close(self, **kwargs): def close(self, **kwargs):
""" """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment