aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility
diff options
context:
space:
mode:
authorMuriithi Frederick Muriuki2018-02-09 10:11:21 +0300
committerPjotr Prins2018-03-26 09:29:29 +0000
commit49f3111bcac8d69dea52ff75bdd39e01e99c2f02 (patch)
tree4ce825fd9b079b3a4d88812c4588e9921baaeb90 /wqflask/utility
parent20950a4dc73a310aea12c601b837ccad369ba49b (diff)
downloadgenenetwork2-49f3111bcac8d69dea52ff75bdd39e01e99c2f02.tar.gz
Add check for elasticsearch
* Add some extra checks to ensure that elasticsearch is running before presenting the UI to the user.
Diffstat (limited to 'wqflask/utility')
-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