forked from tanner/qotnews
Archive WSJ articles first, catch KeyboardInterrupt
This commit is contained in:
@@ -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...')
|
||||
|
Reference in New Issue
Block a user