diff options
author | Muriithi Frederick Muriuki | 2018-02-09 10:11:21 +0300 |
---|---|---|
committer | Pjotr Prins | 2018-03-26 09:29:29 +0000 |
commit | 49f3111bcac8d69dea52ff75bdd39e01e99c2f02 (patch) | |
tree | 4ce825fd9b079b3a4d88812c4588e9921baaeb90 /wqflask/utility/elasticsearch_tools.py | |
parent | 20950a4dc73a310aea12c601b837ccad369ba49b (diff) | |
download | genenetwork2-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/elasticsearch_tools.py')
-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 |