feat(mall): 代码优化

master
waynaqua 1 year ago
parent 5a34ef8eb9
commit 4d81ce7577

@ -20,7 +20,8 @@ public class ElasticClientConfig {
// 开始设置用户名和密码 // 开始设置用户名和密码
CredentialsProvider credentialsProvider = new BasicCredentialsProvider(); CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(config.getUsername(), config.getPassword())); 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; return builder;
} }

Loading…
Cancel
Save