diff options
author | Muriithi Frederick Muriuki | 2018-03-31 14:45:17 +0300 |
---|---|---|
committer | Muriithi Frederick Muriuki | 2018-03-31 14:45:17 +0300 |
commit | 31747256e466456cc88aac60780836a6534f18cd (patch) | |
tree | a7b371e4ec217ffb37594e15f5e603ae28511dc2 /wqflask/utility/elasticsearch_tools.py | |
parent | cfce6d80be4fb38573c37d1943db2687d54cf2fc (diff) | |
parent | 5424741a4a126bfd5f04df7cbcdc30b4e1376b86 (diff) | |
download | genenetwork2-31747256e466456cc88aac60780836a6534f18cd.tar.gz |
Merge branch 'testing' of https://github.com/genenetwork/genenetwork2 into testing
* Fix conflicts
Diffstat (limited to 'wqflask/utility/elasticsearch_tools.py')
-rw-r--r-- | wqflask/utility/elasticsearch_tools.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/wqflask/utility/elasticsearch_tools.py b/wqflask/utility/elasticsearch_tools.py index 2d3d5add..075a8f65 100644 --- a/wqflask/utility/elasticsearch_tools.py +++ b/wqflask/utility/elasticsearch_tools.py @@ -6,6 +6,11 @@ logger = getLogger(__name__) from utility.tools import ELASTICSEARCH_HOST, ELASTICSEARCH_PORT +def test_elasticsearch_connection(): + es = Elasticsearch(['http://'+ELASTICSEARCH_HOST+":"+str(ELASTICSEARCH_PORT)+'/'], verify_certs=True) + if not es.ping(): + logger.warning("Elasticsearch is DOWN") + def get_elasticsearch_connection(): logger.info("get_elasticsearch_connection") es = None |