From c9e1eaf1821f628ebd59d1895bad1d3af0b207c0 Mon Sep 17 00:00:00 2001 From: Starow Date: Fri, 8 Aug 2014 17:04:25 +0200 Subject: [PATCH] Improving cache code --- bin/packages/Paste.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/packages/Paste.py b/bin/packages/Paste.py index 1d59f917..795cfd22 100755 --- a/bin/packages/Paste.py +++ b/bin/packages/Paste.py @@ -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): """