From eccefa27a666c0ccd469c46159f3e001b47ac66d Mon Sep 17 00:00:00 2001 From: Miguel Paolino Date: Tue, 30 Jul 2024 15:01:16 -0300 Subject: [PATCH] adds custom timeout to all clients (#560) --- pgsync/search_client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pgsync/search_client.py b/pgsync/search_client.py index b0524a6..a84fa1d 100644 --- a/pgsync/search_client.py +++ b/pgsync/search_client.py @@ -387,6 +387,7 @@ def get_search_client( use_ssl=True, verify_certs=True, connection_class=connection_class, + timeout=settings.ELASTICSEARCH_TIMEOUT, ) elif settings.ELASTICSEARCH: return client( @@ -401,6 +402,7 @@ def get_search_client( use_ssl=True, verify_certs=True, node_class=node_class, + timeout=settings.ELASTICSEARCH_TIMEOUT, ) else: hosts: t.List[str] = [url] @@ -436,8 +438,6 @@ def get_search_client( ssl_version: t.Optional[int] = settings.ELASTICSEARCH_SSL_VERSION ssl_context: t.Optional[t.Any] = settings.ELASTICSEARCH_SSL_CONTEXT ssl_show_warn: bool = settings.ELASTICSEARCH_SSL_SHOW_WARN - # Transport - timeout: float = settings.ELASTICSEARCH_TIMEOUT return client( hosts=hosts, http_auth=http_auth, @@ -457,5 +457,5 @@ def get_search_client( ssl_context=ssl_context, ssl_show_warn=ssl_show_warn, # use_ssl=use_ssl, - timeout=timeout, + timeout=settings.ELASTICSEARCH_TIMEOUT, )