mirror of https://gitlab.com/bashrc2/epicyon
More debug
parent
b4aa34490d
commit
45c7896627
2
cache.py
2
cache.py
|
@ -53,7 +53,7 @@ def getPersonFromCache(baseDir: str,personUrl: str,personCache: {}) -> {}:
|
|||
personJson=commentjson.load(fp)
|
||||
break
|
||||
except Exception as e:
|
||||
print('ERROR: unable to load actor from cache '+cacheFilename)
|
||||
print('ERROR: unable to load actor from cache '+cacheFilename+' try '+str(tries))
|
||||
print(e)
|
||||
time.sleep(1)
|
||||
tries+=1
|
||||
|
|
|
@ -316,15 +316,17 @@ def addHtmlTags(baseDir: str,httpPrefix: str, \
|
|||
if not os.path.isfile(baseDir+'/emoji/emoji.json'):
|
||||
copyfile(baseDir+'/emoji/default_emoji.json',baseDir+'/emoji/emoji.json')
|
||||
emojiDictCtr=0
|
||||
while not emojiDict and emojiDictCtr<4:
|
||||
while not emojiDict and emojiDictCtr<5:
|
||||
if emojiDictCtr>0:
|
||||
print('Retry emoji load '+baseDir+'/emoji/emoji.json')
|
||||
try:
|
||||
with open(baseDir+'/emoji/emoji.json', 'r') as fp:
|
||||
emojiDict=commentjson.load(fp)
|
||||
if emojiDictCtr>0:
|
||||
print('emojiDict loaded on try '+str(emojiDictCtr))
|
||||
break
|
||||
except Exception as e:
|
||||
print('Failed to load emoji: '+baseDir+'/emoji/emoji.json '+str(e))
|
||||
print('Failed to load emoji (try '+str(emojiDictCtr)+'): '+baseDir+'/emoji/emoji.json '+str(e))
|
||||
time.sleep(1)
|
||||
emojiDictCtr+=1
|
||||
|
||||
|
|
Loading…
Reference in New Issue