make sure gather phase finishes job if there is a severe error

This commit is contained in:
kindly 2012-12-24 12:21:21 +00:00
parent b940baacc0
commit 36389e7ce0
1 changed files with 7 additions and 1 deletions

View File

@ -115,7 +115,13 @@ def gather_callback(channel, method, header, body):
harvester_found = True harvester_found = True
# Get a list of harvest object ids from the plugin # Get a list of harvest object ids from the plugin
job.gather_started = datetime.datetime.now() job.gather_started = datetime.datetime.now()
harvest_object_ids = harvester.gather_stage(job) try:
harvest_object_ids = harvester.gather_stage(job)
except:
log.error('Gather stage failed unexpectedly')
job.status = 'Errored'
job.save()
continue
job.gather_finished = datetime.datetime.now() job.gather_finished = datetime.datetime.now()
job.save() job.save()
log.debug('Received from plugin''s gather_stage: %r' % harvest_object_ids) log.debug('Received from plugin''s gather_stage: %r' % harvest_object_ids)