base.py 文件源码

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

项目:osint-combiner 作者: sjorsng 项目源码 文件源码
def exists_es_index(str_valid_index):
    """Returns if given index exists in Elasticsearch cluster"""
    connection_attempts = 0
    while connection_attempts < 3:
        try:
            es = get_es_object()
            es_indices = es.indices
            return es_indices.exists(index=str_valid_index)
        except exceptions.ConnectionTimeout:
            connection_attempts += 1
    sys.exit('Elasticsearch connection timeout, exiting now...')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号