From 0b5c3c608a3a54d156e8f6f4b720ece375e30ddc Mon Sep 17 00:00:00 2001 From: kindly Date: Mon, 25 Mar 2013 11:57:57 +0000 Subject: [PATCH] catch and raise gather exception, acking the message --- ckanext/harvest/queue.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ckanext/harvest/queue.py b/ckanext/harvest/queue.py index 71e295e..8fa1537 100644 --- a/ckanext/harvest/queue.py +++ b/ckanext/harvest/queue.py @@ -122,7 +122,11 @@ def gather_callback(channel, method, header, body): # Get a list of harvest object ids from the plugin job.gather_started = datetime.datetime.now() - harvest_object_ids = harvester.gather_stage(job) + try: + harvest_object_ids = harvester.gather_stage(job) + except Exception, e: + channel.basic_ack(method.delivery_tag) + raise job.gather_finished = datetime.datetime.now() job.save()