From 55d2b4e3045d1db50dc0a0e1aa785c9d4f4550b9 Mon Sep 17 00:00:00 2001 From: amercader Date: Wed, 16 Oct 2013 12:59:23 +0100 Subject: [PATCH] Fix purge command --- ckanext/harvest/queue.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ckanext/harvest/queue.py b/ckanext/harvest/queue.py index 72a5e0a..b8c4131 100644 --- a/ckanext/harvest/queue.py +++ b/ckanext/harvest/queue.py @@ -65,13 +65,15 @@ def get_connection_redis(): db=int(config.get('ckan.harvest.mq.redis_db', REDIS_DB))) def purge_queues(): + + backend = config.get('ckan.harvest.mq.type', MQ_TYPE) connection = get_connection() - if config.get('ckan.harvest.mq.type') in ('amqp', 'ampq'): + if backend in ('amqp', 'ampq'): channel = connection.channel() channel.queue_purge(queue='ckan.harvest.gather') channel.queue_purge(queue='ckan.harvest.fetch') return - if config.get('ckan.harvest.mq.type') == 'redis': + if backend == 'redis': connection.flushall() def resubmit_jobs():