Fixing a bug about caching paste inside Redis :)

This commit is contained in:
Starow 2014-08-08 17:23:51 +02:00
parent 7a1db94f9e
commit eb603e8762

View file

@ -94,11 +94,11 @@ class Paste(object):
"""
r_serv = self.cache
if r_serv.exists(self.p_path):
paste = r_serv.get(self.p_path)
else:
if paste is None:
with gzip.open(self.p_path, 'rb') as F:
paste = r_serv.getset(self.p_path, F.read())
paste = F.read()
r_serv.set(self.p_path, paste)
r_serv.expire(self.p_path, 300)
return paste