Fixing a bug about caching paste inside Redis :)

pull/8/head
Starow 2014-08-08 17:23:51 +02:00
parent 7a1db94f9e
commit eb603e8762
1 changed files with 4 additions and 4 deletions

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:
paste = r_serv.get(self.p_path)
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