catch processing exceptions and if entry_orig_state is processed, then ignore the exception

This commit is contained in:
Rodney Ewing 2013-08-14 14:54:10 -07:00
parent 79f84d7e47
commit 7d3fda06b0

View File

@ -93,7 +93,18 @@ class ProcessMedia(task.Task):
_log.debug('Processing {0}'.format(entry))
processor.process(**reprocess_info)
try:
processor.process(**reprocess_info)
except Exception as exc:
if processor.entry_orig_state == 'processed':
_log.error(
'Entry {0} failed to process due to the following'
' error: {1}'.format(entry.id, exc))
_log.info(
'Setting entry.state back to "processed"')
pass
else:
raise
# We set the state to processed and save the entry here so there's
# no need to save at the end of the processing stage, probably ;)