Re-establish session for newswire if needed

main
Bob Mottram 2020-11-03 16:08:31 +00:00
parent c8858f871a
commit 0e9bb51985
1 changed files with 9 additions and 3 deletions

View File

@ -31,6 +31,7 @@ from utils import saveJson
from utils import getStatusNumber
from utils import clearFromPostCaches
from inbox import storeHashTags
from session import createSession
def updateFeedsOutboxIndex(baseDir: str, domain: str, postId: str) -> None:
@ -694,9 +695,14 @@ def runNewswireDaemon(baseDir: str, httpd,
while True:
# has the session been created yet?
if not httpd.session:
print('Newswire daemon waiting for session')
time.sleep(60)
continue
print('Newswire daemon has no session')
httpd.session = createSession(httpd.proxyType)
if not httpd.session:
print('Newswire daemon waiting for session')
time.sleep(60)
continue
else:
print('Newswire daemon session established')
# try to update the feeds
newNewswire = None