mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 00:28:22 +00:00
Fixing a bug about caching paste inside Redis :)
This commit is contained in:
parent
7a1db94f9e
commit
eb603e8762
1 changed files with 4 additions and 4 deletions
|
@ -94,11 +94,11 @@ class Paste(object):
|
||||||
"""
|
"""
|
||||||
r_serv = self.cache
|
r_serv = self.cache
|
||||||
|
|
||||||
if r_serv.exists(self.p_path):
|
|
||||||
paste = r_serv.get(self.p_path)
|
paste = r_serv.get(self.p_path)
|
||||||
else:
|
if paste is None:
|
||||||
with gzip.open(self.p_path, 'rb') as F:
|
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)
|
r_serv.expire(self.p_path, 300)
|
||||||
return paste
|
return paste
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue