aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility/elasticsearch_tools.py
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask/utility/elasticsearch_tools.py')
-rw-r--r--wqflask/utility/elasticsearch_tools.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/wqflask/utility/elasticsearch_tools.py b/wqflask/utility/elasticsearch_tools.py
index cce210c3..293a9ae6 100644
--- a/wqflask/utility/elasticsearch_tools.py
+++ b/wqflask/utility/elasticsearch_tools.py
@@ -52,7 +52,7 @@ def test_elasticsearch_connection():
if not es.ping():
logger.warning("Elasticsearch is DOWN")
-def get_elasticsearch_connection():
+def get_elasticsearch_connection(for_user=True):
"""Return a connection to ES. Returns None on failure"""
logger.info("get_elasticsearch_connection")
es = None
@@ -65,7 +65,8 @@ def get_elasticsearch_connection():
"host": ELASTICSEARCH_HOST, "port": ELASTICSEARCH_PORT
}]) if (ELASTICSEARCH_HOST and ELASTICSEARCH_PORT) else None
- setup_users_index(es)
+ if for_user:
+ setup_users_index(es)
es_logger = logging.getLogger("elasticsearch")
es_logger.setLevel(logging.INFO)