plugin/etcd: the etcd client adds the DialKeepAliveTime parameter ()

This commit is contained in:
journey-c 2023-11-11 06:17:55 +08:00 committed by GitHub
parent 8964fc2180
commit 7765aa87a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -99,8 +99,9 @@ func etcdParse(c *caddy.Controller) (*Etcd, error) {
func newEtcdClient(endpoints []string, cc *tls.Config, username, password string) (*etcdcv3.Client, error) {
etcdCfg := etcdcv3.Config{
Endpoints: endpoints,
TLS: cc,
Endpoints: endpoints,
TLS: cc,
DialKeepAliveTime: etcdTimeout,
}
if username != "" && password != "" {
etcdCfg.Username = username