mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-26 15:57:16 +00:00
Improving cache code
This commit is contained in:
parent
0a503db815
commit
c9e1eaf182
1 changed files with 5 additions and 5 deletions
|
@ -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):
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue