It's annoying to have a few feeds processed successfully and then have
one feed with a configuration error take down the process without
saving. With this commit, we always safe the feeds, regardless of any
error. We also catch and log any RSS2EmailError, not just the
NoToEmailAddress and ProcessingErrors we caught earlier.
Signed-off-by: W. Trevor King <wking@tremily.us>
"Fetch feeds and send entry emails."
if not args.index:
args.index = range(len(feeds))
- for index in args.index:
- feed = feeds.index(index)
- if feed.active:
- try:
- feed.run(send=args.send)
- except _error.NoToEmailAddress as e:
- e.log()
- except _error.ProcessingError as e:
- e.log()
- feeds.save()
+ try:
+ for index in args.index:
+ feed = feeds.index(index)
+ if feed.active:
+ try:
+ feed.run(send=args.send)
+ except _error.RSS2EmailError as e:
+ e.log()
+ finally:
+ feeds.save()
def list(feeds, args):
"List all the feeds in the database"