fix dying on exception

This commit is contained in:
Christoph J. Scherr 2023-05-30 18:18:33 +02:00
parent e564898be6
commit bebb238655
Signed by: PlexSheep
GPG Key ID: 25B4ACF7D88186CC
1 changed files with 5 additions and 5 deletions

View File

@ -30,8 +30,8 @@ def read_known() -> list:
def daemon(): def daemon():
try: while True:
while True: try:
r = requests.get(CONFIG['URL']) r = requests.get(CONFIG['URL'])
soup = BeautifulSoup(r.content, features='xml') soup = BeautifulSoup(r.content, features='xml')
articles = soup.findAll('item') articles = soup.findAll('item')
@ -108,9 +108,9 @@ Länge: {dur}
print("="*120 + "\nentering sleep for %d seconds at %s" % (int(CONFIG['SLEEP_SECS']), datetime.now())) print("="*120 + "\nentering sleep for %d seconds at %s" % (int(CONFIG['SLEEP_SECS']), datetime.now()))
print("="*120) print("="*120)
sleep(int(CONFIG['SLEEP_SECS'])) sleep(int(CONFIG['SLEEP_SECS']))
except ValueError as e: except ValueError as e:
print(e) print(e)
pass pass
if __name__ == "__main__": if __name__ == "__main__":
daemon() daemon()