aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility/elasticsearch_tools.py
diff options
context:
space:
mode:
authorPjotr Prins2018-03-20 11:02:25 +0000
committerPjotr Prins2018-03-20 11:02:25 +0000
commitafd8d38c19be78b7e962f4edea0972ac3f48c25d (patch)
treea1e87ced6efc40eebcf2e22ac9dd3b9ccfb0204a /wqflask/utility/elasticsearch_tools.py
parentab369995d4a16de5d20123192279e32658f870a0 (diff)
downloadgenenetwork2-afd8d38c19be78b7e962f4edea0972ac3f48c25d.tar.gz
Refactor startup config for gunicorn and werkzeug
Diffstat (limited to 'wqflask/utility/elasticsearch_tools.py')
-rw-r--r--wqflask/utility/elasticsearch_tools.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/wqflask/utility/elasticsearch_tools.py b/wqflask/utility/elasticsearch_tools.py
index 2d3d5add..734379f7 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+":"+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