mirror of https://gitlab.com/bashrc2/epicyon
Add a few retries
parent
1d3c74bd21
commit
c1acbf0deb
32
inbox.py
32
inbox.py
|
@ -996,9 +996,19 @@ def receiveAnnounce(session,handle: str,baseDir: str, \
|
||||||
print('DEBUG: Obtaining actor for announce post from cache '+lookupActor)
|
print('DEBUG: Obtaining actor for announce post from cache '+lookupActor)
|
||||||
if not getPersonFromCache(baseDir,lookupActor,personCache):
|
if not getPersonFromCache(baseDir,lookupActor,personCache):
|
||||||
print('DEBUG: retrieve actor for announce post '+lookupActor)
|
print('DEBUG: retrieve actor for announce post '+lookupActor)
|
||||||
getPersonPubKey(baseDir,session,lookupActor, \
|
for tries in range(3):
|
||||||
personCache,debug, \
|
pubKey= \
|
||||||
__version__,httpPrefix,domain)
|
getPersonPubKey(baseDir,session,lookupActor, \
|
||||||
|
personCache,debug, \
|
||||||
|
__version__,httpPrefix,domain)
|
||||||
|
if pubKey:
|
||||||
|
print('DEBUG: public key: '+str(pubKey))
|
||||||
|
break
|
||||||
|
|
||||||
|
if debug:
|
||||||
|
print('DEBUG: Retry '+str(tries+1)+ \
|
||||||
|
' obtaining actor for '+lookupActor)
|
||||||
|
time.sleep(5)
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: announced/repeated post arrived in inbox')
|
print('DEBUG: announced/repeated post arrived in inbox')
|
||||||
return True
|
return True
|
||||||
|
@ -1185,9 +1195,19 @@ def obtainAvatarForReplyPost(session,baseDir: str,httpPrefix: str,domain: str,pe
|
||||||
print('DEBUG: Obtaining actor for reply post '+lookupActor)
|
print('DEBUG: Obtaining actor for reply post '+lookupActor)
|
||||||
if not getPersonFromCache(baseDir,lookupActor,personCache):
|
if not getPersonFromCache(baseDir,lookupActor,personCache):
|
||||||
print('DEBUG: retrieve actor for announce post '+lookupActor)
|
print('DEBUG: retrieve actor for announce post '+lookupActor)
|
||||||
getPersonPubKey(baseDir,session,lookupActor, \
|
for tries in range(3):
|
||||||
personCache,debug, \
|
pubKey= \
|
||||||
__version__,httpPrefix,domain)
|
getPersonPubKey(baseDir,session,lookupActor, \
|
||||||
|
personCache,debug, \
|
||||||
|
__version__,httpPrefix,domain)
|
||||||
|
if pubKey:
|
||||||
|
print('DEBUG: public key: '+str(pubKey))
|
||||||
|
break
|
||||||
|
|
||||||
|
if debug:
|
||||||
|
print('DEBUG: Retry '+str(tries+1)+ \
|
||||||
|
' obtaining actor for '+lookupActor)
|
||||||
|
time.sleep(5)
|
||||||
|
|
||||||
def inboxAfterCapabilities(session,keyId: str,handle: str,messageJson: {}, \
|
def inboxAfterCapabilities(session,keyId: str,handle: str,messageJson: {}, \
|
||||||
baseDir: str,httpPrefix: str,sendThreads: [], \
|
baseDir: str,httpPrefix: str,sendThreads: [], \
|
||||||
|
|
Loading…
Reference in New Issue