fix with try-catch
This commit is contained in:
parent
b12a3570b0
commit
54a4c7e55a
|
@ -168,8 +168,11 @@ def _update_current_story(item):
|
||||||
|
|
||||||
valid = feed.update_story(story, urlref=item['urlref'])
|
valid = feed.update_story(story, urlref=item['urlref'])
|
||||||
if valid:
|
if valid:
|
||||||
|
try:
|
||||||
database.put_story(story)
|
database.put_story(story)
|
||||||
search.put_story(story)
|
search.put_story(story)
|
||||||
|
except database.IntegrityError:
|
||||||
|
logging.info('Unable to add story with ref ' + ref)
|
||||||
else:
|
else:
|
||||||
database.del_ref(item['ref'])
|
database.del_ref(item['ref'])
|
||||||
logging.info('Removed ref {}'.format(item['ref']))
|
logging.info('Removed ref {}'.format(item['ref']))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user