fix dying on exception
This commit is contained in:
parent
e564898be6
commit
bebb238655
10
src/main.py
10
src/main.py
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue