Archive WSJ articles first, catch KeyboardInterrupt

This commit is contained in:
Tanner
2019-10-15 21:03:47 +00:00
parent c4281ca215
commit 8f8a11954a
5 changed files with 26 additions and 11 deletions
+2
View File
@@ -152,6 +152,8 @@ try:
news_index += 1
if news_index == CACHE_LENGTH: news_index = 0
except KeyboardInterrupt:
logging.info('Exiting...')
finally:
with shelve.open(DATA_FILE) as db:
logging.info('Writing caches to disk...')