make gather phase as finished if there is an error
This commit is contained in:
parent
bd761498f0
commit
7d7657f94a
|
@ -124,10 +124,13 @@ def gather_callback(channel, method, header, body):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
harvest_object_ids = harvester.gather_stage(job)
|
harvest_object_ids = harvester.gather_stage(job)
|
||||||
except Exception, e:
|
except (Exception, KeyboardInterrupt):
|
||||||
channel.basic_ack(method.delivery_tag)
|
channel.basic_ack(method.delivery_tag)
|
||||||
|
model.Session.query(HarvestObject).filter_by(
|
||||||
|
harvest_job_id=job.id
|
||||||
|
).update(dict(state='ERROR', current=False))
|
||||||
raise
|
raise
|
||||||
|
finally:
|
||||||
job.gather_finished = datetime.datetime.now()
|
job.gather_finished = datetime.datetime.now()
|
||||||
job.save()
|
job.save()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue