More debug

main2
Bob Mottram 2019-10-16 15:21:01 +01:00
parent b4aa34490d
commit 45c7896627
2 changed files with 5 additions and 3 deletions

View File

@ -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

View File

@ -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