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():
|
||||
|
||||
try:
|
||||
while True:
|
||||
while True:
|
||||
try:
|
||||
r = requests.get(CONFIG['URL'])
|
||||
soup = BeautifulSoup(r.content, features='xml')
|
||||
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)
|
||||
sleep(int(CONFIG['SLEEP_SECS']))
|
||||
except ValueError as e:
|
||||
print(e)
|
||||
pass
|
||||
except ValueError as e:
|
||||
print(e)
|
||||
pass
|
||||
|
||||
if __name__ == "__main__":
|
||||
daemon()
|
||||
|
|
Loading…
Reference in New Issue