__init__.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:kibtool 作者: jpparis-orange 项目源码 文件源码
def get_client():
  global client
  if client is not None:
    return client

  client = Elasticsearch([os.environ.get('TEST_ES_SERVER', {})], timeout=300)

  # wait for yellow status
  for _ in range(100):
    time.sleep(.1)
    try:
      client.cluster.health(wait_for_status='yellow')
      return client
    except ConnectionError:
      continue
  else:
    # timeout
    raise SkipTest("Elasticsearch failed to start.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号