Commit 050209f0 authored by David Mendez's avatar David Mendez

increase the timeout in the connection to elasticsearch

parent fc46ff12
......@@ -3,7 +3,7 @@ Module that handles the connection with elasticsearch
"""
import os
from elasticsearch import Elasticsearch
import elasticsearch
class ElasticsearchConnectionConfigError(Exception):
......@@ -48,8 +48,13 @@ def get_es_connection(elasticsearch_host, elasticsearch_port, username, password
:return: a new connection with the parameter given
"""
return Elasticsearch(
[elasticsearch_host],
return elasticsearch.Elasticsearch(
hosts=[{
'host': elasticsearch_host,
'port': elasticsearch_port,
'transport_class': elasticsearch.Urllib3HttpConnection,
'timeout': 60
}],
http_auth=(username, password),
port=elasticsearch_port
retry_on_timeout=True
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment