def purge_queues():
backend = config.get('ckan.harvest.mq.type', MQ_TYPE)
connection = get_connection()
if backend in ('amqp', 'ampq'):
channel = connection.channel()
channel.queue_purge(queue=get_gather_queue_name())
log.info('AMQP queue purged: %s', get_gather_queue_name())
channel.queue_purge(queue=get_fetch_queue_name())
log.info('AMQP queue purged: %s', get_fetch_queue_name())
elif backend == 'redis':
get_gather_consumer().queue_purge()
log.info('Redis gather queue purged')
get_fetch_consumer().queue_purge()
log.info('Redis fetch queue purged')
评论列表
文章目录