mirror of https://gitlab.com/bashrc2/epicyon
json post timeout
parent
f534899681
commit
62ae21dd3e
2
like.py
2
like.py
|
@ -203,7 +203,7 @@ def sendLikeViaServer(baseDir: str, session,
|
|||
'Content-type': 'application/json',
|
||||
'Authorization': authHeader
|
||||
}
|
||||
postResult = postJson(session, newLikeJson, [], inboxUrl, headers)
|
||||
postResult = postJson(session, newLikeJson, [], inboxUrl, headers, 30)
|
||||
if not postResult:
|
||||
print('WARN: POST announce failed for c2s to ' + inboxUrl)
|
||||
return 5
|
||||
|
|
|
@ -348,7 +348,7 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str,
|
|||
_sayCommand(sayStr, screenreader,
|
||||
systemLanguage, espeak)
|
||||
if screenreader:
|
||||
keyPress = _waitForKeypress(2, debug)
|
||||
keyPress = _waitForKeypress(2, dbug)
|
||||
break
|
||||
elif keyPress == 'reply' or keyPress == 'r':
|
||||
if speakerJson.get('id'):
|
||||
|
|
|
@ -137,7 +137,7 @@ def getJson(session, url: str, headers: {}, params: {},
|
|||
|
||||
|
||||
def postJson(session, postJsonObject: {}, federationList: [],
|
||||
inboxUrl: str, headers: {}) -> str:
|
||||
inboxUrl: str, headers: {}, timeoutSec=60) -> str:
|
||||
"""Post a json message to the inbox of another person
|
||||
"""
|
||||
# check that we are posting to a permitted domain
|
||||
|
@ -149,7 +149,7 @@ def postJson(session, postJsonObject: {}, federationList: [],
|
|||
postResult = \
|
||||
session.post(url=inboxUrl,
|
||||
data=json.dumps(postJsonObject),
|
||||
headers=headers)
|
||||
headers=headers, timeout=timeoutSec)
|
||||
except requests.exceptions.RequestException as e:
|
||||
print('ERROR: postJson requests failed ' + inboxUrl + ' ' +
|
||||
json.dumps(postJsonObject) + ' ' + str(headers))
|
||||
|
|
Loading…
Reference in New Issue