def queue_empty(self):
try:
creds = pika.PlainCredentials(self.ansible_config['rabbitmq_user'],
self.ansible_config['rabbitmq_password'])
conn = pika.BlockingConnection(pika.ConnectionParameters(host=self.ansible_config['rabbitmq_host'],
credentials=creds))
ch = conn.channel()
m = ch.queue_declare(queue=self.qname, durable=True, arguments={'x-max-priority': 3})
self.logger.debug('Messages in the queue: {}'.format(m.method.message_count))
return m.method.message_count == 0
except Exception as e:
self.logger.warning(e, exc_info=True)
return True
cluster_auto_start_daemon.py 文件源码
python
阅读 30
收藏 0
点赞 0
评论 0
评论列表
文章目录