diff options
author | Muriithi Frederick Muriuki | 2018-02-09 10:11:21 +0300 |
---|---|---|
committer | Muriithi Frederick Muriuki | 2018-02-09 10:11:21 +0300 |
commit | 25ff5e9e47c568547a855e42a4fd43477db2a61e (patch) | |
tree | 9c53e5832397473358d8c4f897fd339c281e4734 | |
parent | 03edecad79c4e8e1e10734e9e8f21f5da7912851 (diff) | |
download | genenetwork2-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.py | 4 |
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 |