From aba6636acb11ce632b3f4d85f8df380c373cf8e8 Mon Sep 17 00:00:00 2001 From: Amol Patil Date: Thu, 19 Dec 2024 23:07:42 +0530 Subject: [PATCH 1/2] added hosts string suport --- lib/chewy.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/chewy.rb b/lib/chewy.rb index ebc62c76..363a1ba1 100644 --- a/lib/chewy.rb +++ b/lib/chewy.rb @@ -114,6 +114,9 @@ def derive_name(index_name) # def client(hosts = nil) # # We are changing this to support multiple clusters in chewy. + if hosts.is_a?(String) + hosts = hosts.to_sym + end thread_cache_key = if hosts "chewy_client_#{hosts}" else From e99f214126371242cc3a4204a22b2c28e8a1cf00 Mon Sep 17 00:00:00 2001 From: Amol Patil Date: Thu, 19 Dec 2024 23:11:02 +0530 Subject: [PATCH 2/2] made one liner --- lib/chewy.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/chewy.rb b/lib/chewy.rb index 363a1ba1..64cb35e9 100644 --- a/lib/chewy.rb +++ b/lib/chewy.rb @@ -114,9 +114,7 @@ def derive_name(index_name) # def client(hosts = nil) # # We are changing this to support multiple clusters in chewy. - if hosts.is_a?(String) - hosts = hosts.to_sym - end + hosts = hosts.to_sym if hosts.is_a?(String) thread_cache_key = if hosts "chewy_client_#{hosts}" else