mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-27 00:07:16 +00:00
Fix #314
Replace char on redis encoding error. Try to use local file on other error.
This commit is contained in:
parent
0389b9c23b
commit
05079c143c
1 changed files with 8 additions and 1 deletions
|
@ -70,6 +70,7 @@ class Paste(object):
|
|||
host=cfg.get("Redis_Queues", "host"),
|
||||
port=cfg.getint("Redis_Queues", "port"),
|
||||
db=cfg.getint("Redis_Queues", "db"),
|
||||
encoding_errors='replace',
|
||||
decode_responses=True)
|
||||
self.store = redis.StrictRedis(
|
||||
host=cfg.get("Redis_Data_Merging", "host"),
|
||||
|
@ -125,7 +126,13 @@ class Paste(object):
|
|||
|
||||
"""
|
||||
|
||||
paste = self.cache.get(self.p_path)
|
||||
try:
|
||||
paste = self.cache.get(self.p_path)
|
||||
except Exception as e:
|
||||
print("ERROR in: " + self.p_path)
|
||||
print(e)
|
||||
paste = None
|
||||
|
||||
if paste is None:
|
||||
try:
|
||||
with gzip.open(self.p_path, 'r') as f:
|
||||
|
|
Loading…
Reference in a new issue