From ff8bdaa9cf3f8118577f6583aec32dfabc065942 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 4 Oct 2020 22:01:17 +0100 Subject: [PATCH] Debug --- daemon.py | 1 + newswire.py | 26 +++++++++++--------------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/daemon.py b/daemon.py index 8b668617..1d574fc2 100644 --- a/daemon.py +++ b/daemon.py @@ -1069,6 +1069,7 @@ class PubServer(BaseHTTPRequestHandler): if self.path.startswith('/icons/') or \ self.path.startswith('/avatars/') or \ self.path.startswith('/favicon.ico'): + self.path.startswith('/newswire.xml'): return False # token based authenticated used by the web interface diff --git a/newswire.py b/newswire.py index 3a1476e7..4d7b2a3a 100644 --- a/newswire.py +++ b/newswire.py @@ -182,7 +182,7 @@ def runNewswireDaemon(baseDir: str, httpd): """Periodically updates RSS feeds """ # initial sleep to allow the system to start up - time.sleep(100) + time.sleep(70) while True: # has the session been created yet? if not httpd.session: @@ -192,21 +192,17 @@ def runNewswireDaemon(baseDir: str, httpd): # try to update the feeds newNewswire = None - loaded = False - try: - newNewswire = getDictFromNewswire(httpd.session, baseDir) - loaded = True - except BaseException: - print('WARN: unable to update newswire') - pass + # try: + newNewswire = getDictFromNewswire(httpd.session, baseDir) + # except BaseException: + # print('WARN: unable to update newswire') + # time.sleep(120) + # continue - if loaded: - httpd.newswire = newNewswire - print('Newswire updated') - # wait a while before the next feeds update - time.sleep(1200) - else: - time.sleep(120) + httpd.newswire = newNewswire + print('Newswire updated') + # wait a while before the next feeds update + time.sleep(1200) def runNewswireWatchdog(projectVersion: str, httpd) -> None: