aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuriithi Frederick Muriuki2018-02-09 10:11:21 +0300
committerMuriithi Frederick Muriuki2018-02-09 10:11:21 +0300
commit25ff5e9e47c568547a855e42a4fd43477db2a61e (patch)
tree9c53e5832397473358d8c4f897fd339c281e4734
parent03edecad79c4e8e1e10734e9e8f21f5da7912851 (diff)
downloadgenenetwork2-25ff5e9e47c568547a855e42a4fd43477db2a61e.tar.gz
Add check for elasticsearch
* Add some extra checks to ensure that elasticsearch is running before presenting the UI to the user.
-rw-r--r--wqflask/utility/elasticsearch_tools.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/wqflask/utility/elasticsearch_tools.py b/wqflask/utility/elasticsearch_tools.py
index ea636b2e..a0383033 100644
--- a/wqflask/utility/elasticsearch_tools.py
+++ b/wqflask/utility/elasticsearch_tools.py
@@ -7,6 +7,10 @@ try:
"host": ELASTICSEARCH_HOST
, "port": ELASTICSEARCH_PORT
}]) if (ELASTICSEARCH_HOST and ELASTICSEARCH_PORT) else None
+
+ # Check if elasticsearch is running
+ if not es.ping():
+ es = None
except:
es = None