Skip to content

Commit a87dcef

Browse files
committed
[FIX] connector_elastic: timeout and retry impl.
PR OCA#208 introduced configurable timeouts and retries on the ES backend. However the implementation only added this feature for auth_type api_key and not for HTTP simple auth. This pull request adds the missing support.
1 parent a2f32de commit a87dcef

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

connector_elasticsearch/tools/adapter.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,12 @@ def _get_es_client(self):
6868
if backend.auth_type == "http":
6969
auth = (backend.es_user, backend.es_password)
7070
return elasticsearch.Elasticsearch(
71-
[backend.es_server_host], http_auth=auth, use_ssl=backend.ssl
71+
[backend.es_server_host],
72+
http_auth=auth,
73+
use_ssl=backend.ssl,
74+
timeout=max(backend.es_timeout, 1),
75+
retry_on_timeout=backend.es_retry_on_timeout,
76+
max_retries=max(0, backend.es_max_retries),
7277
)
7378

7479
def test_connection(self):

0 commit comments

Comments
 (0)