mirror of https://gitlab.com/bashrc2/epicyon
Logging of posts
parent
3e1eaf035b
commit
5def73177e
13
posts.py
13
posts.py
|
@ -906,12 +906,9 @@ def threadSendPost(session,postJsonStr: str,federationList: [],\
|
||||||
inboxUrl,signatureHeaderJson, \
|
inboxUrl,signatureHeaderJson, \
|
||||||
"inbox:write",debug)
|
"inbox:write",debug)
|
||||||
if postResult:
|
if postResult:
|
||||||
if debug:
|
logStr='Success on try '+str(tries)+': '+postJsonStr
|
||||||
print('DEBUG: json post to '+inboxUrl+' succeeded')
|
|
||||||
if tries==0:
|
|
||||||
logStr=postJsonStr
|
|
||||||
else:
|
else:
|
||||||
logStr='Try '+str(tries)+': '+postJsonStr
|
logStr='Retry '+str(tries)+': '+postJsonStr
|
||||||
postLog.append(logStr)
|
postLog.append(logStr)
|
||||||
# keep the length of the log finite
|
# keep the length of the log finite
|
||||||
# Don't accumulate massive files on systems with limited resources
|
# Don't accumulate massive files on systems with limited resources
|
||||||
|
@ -921,8 +918,10 @@ def threadSendPost(session,postJsonStr: str,federationList: [],\
|
||||||
postLogFilename=baseDir+'/post.log'
|
postLogFilename=baseDir+'/post.log'
|
||||||
with open(postLogFilename, "a+") as logFile:
|
with open(postLogFilename, "a+") as logFile:
|
||||||
logFile.write(logStr+'\n')
|
logFile.write(logStr+'\n')
|
||||||
# for line in postLog:
|
|
||||||
# print(line, file=logFile)
|
if postResult:
|
||||||
|
if debug:
|
||||||
|
print('DEBUG: json post to '+inboxUrl+' succeeded')
|
||||||
# our work here is done
|
# our work here is done
|
||||||
break
|
break
|
||||||
if debug:
|
if debug:
|
||||||
|
|
Loading…
Reference in New Issue