mirror of https://gitlab.com/bashrc2/epicyon
Don't use loop
parent
71f2b04bfc
commit
e02fadcef0
18
posts.py
18
posts.py
|
@ -1928,19 +1928,11 @@ def createSharedInboxIndex(baseDir: str,sharedBoxDir: str, \
|
||||||
|
|
||||||
sharedInboxFilename=os.path.join(sharedBoxDir, postFilename)
|
sharedInboxFilename=os.path.join(sharedBoxDir, postFilename)
|
||||||
# get the actor from the shared post
|
# get the actor from the shared post
|
||||||
loadedPost=False
|
try:
|
||||||
tries=0
|
with open(sharedInboxFilename, 'r') as fp:
|
||||||
while tries<5:
|
postJsonObject=commentjson.load(fp)
|
||||||
try:
|
except Exception as e:
|
||||||
with open(sharedInboxFilename, 'r') as fp:
|
print('WARN: commentjson exception createBoxBase - '+str(e))
|
||||||
postJsonObject=commentjson.load(fp)
|
|
||||||
loadedPost=True
|
|
||||||
break
|
|
||||||
except Exception as e:
|
|
||||||
print('WARN: commentjson exception createBoxBase - '+str(e))
|
|
||||||
time.sleep(1)
|
|
||||||
tries+=1
|
|
||||||
if not loadedPost:
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
actorNickname=getNicknameFromActor(postJsonObject['actor'])
|
actorNickname=getNicknameFromActor(postJsonObject['actor'])
|
||||||
|
|
Loading…
Reference in New Issue