Improving cache code

This commit is contained in:
Starow 2014-08-08 17:04:25 +02:00
parent 0a503db815
commit c9e1eaf182

View file

@ -56,6 +56,11 @@ class Paste(object):
self.p_size = round(os.path.getsize(self.p_path)/1024.0,2)
self.cache = redis.StrictRedis(
host = cfg.get("Redis_Queues", "host"),
port = cfg.getint("Redis_Queues", "port"),
db = cfg.getint("Redis_Queues", "db"))
self.p_mime = magic.from_buffer(self.get_p_content(), mime = True)
self.p_encoding = None
@ -76,11 +81,6 @@ class Paste(object):
self.p_source = var[-5]
self.cache = redis.StrictRedis(
host = cfg.get("Redis_Queues", "host"),
port = cfg.getint("Redis_Queues", "port"),
db = cfg.getint("Redis_Queues", "db"))
def get_p_content(self):
"""