Log to warning when filter has an error.
This commit is contained in:
parent
203ce71454
commit
465330fae1
1 changed files with 17 additions and 9 deletions
|
@ -1,6 +1,10 @@
|
|||
import flask; from flask import request
|
||||
import traceback
|
||||
|
||||
from voussoirkit import flasktools
|
||||
from voussoirkit import vlogging
|
||||
|
||||
log = vlogging.get_logger(__name__)
|
||||
|
||||
from .. import common
|
||||
|
||||
|
@ -77,6 +81,7 @@ def post_run_filter_now(filter_id):
|
|||
else:
|
||||
feed = None
|
||||
|
||||
try:
|
||||
with common.bringdb.transaction:
|
||||
filt = common.get_filter(filter_id, response_type='json')
|
||||
newss = list(common.bringdb.get_newss(
|
||||
|
@ -84,8 +89,11 @@ def post_run_filter_now(filter_id):
|
|||
read=None,
|
||||
recycled=None,
|
||||
))
|
||||
log.info('Running %s.', filt)
|
||||
for news in newss:
|
||||
filt.process_news(news)
|
||||
except Exception as exc:
|
||||
log.warning('Running %s raised:\n%s', filt, traceback.format_exc())
|
||||
|
||||
return flasktools.json_response({})
|
||||
|
||||
|
|
Loading…
Reference in a new issue