From 4d81ce7577db9f2144f95fd1f636bbe77e7d3f3f Mon Sep 17 00:00:00 2001 From: waynaqua <1669738430@qq.com> Date: Thu, 20 Jul 2023 09:45:42 +0800 Subject: [PATCH] =?UTF-8?q?feat(mall):=20=E4=BB=A3=E7=A0=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/wayn/data/elastic/config/ElasticClientConfig.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/waynboot-data/waynboot-data-elastic/src/main/java/com/wayn/data/elastic/config/ElasticClientConfig.java b/waynboot-data/waynboot-data-elastic/src/main/java/com/wayn/data/elastic/config/ElasticClientConfig.java index 2f86260..48e89d3 100644 --- a/waynboot-data/waynboot-data-elastic/src/main/java/com/wayn/data/elastic/config/ElasticClientConfig.java +++ b/waynboot-data/waynboot-data-elastic/src/main/java/com/wayn/data/elastic/config/ElasticClientConfig.java @@ -20,7 +20,8 @@ public class ElasticClientConfig { // 开始设置用户名和密码 CredentialsProvider credentialsProvider = new BasicCredentialsProvider(); credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(config.getUsername(), config.getPassword())); - builder.setHttpClientConfigCallback(f -> f.setDefaultCredentialsProvider(credentialsProvider)); + builder.setHttpClientConfigCallback(f -> f.setDefaultCredentialsProvider(credentialsProvider) + .setKeepAliveStrategy((response, context) -> 1000 * 60)); return builder; }