Skip to content

Commit

Permalink
*: add auto sync configuration in creating etcd client (#1240)
Browse files Browse the repository at this point in the history
close #1236
  • Loading branch information
lichunzhu authored Jun 5, 2023
1 parent f883b1e commit 3621449
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/etcd/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ func NewClient(cli *clientv3.Client, root string) *Client {
// NewClientFromCfg returns a wrapped etcd client
func NewClientFromCfg(endpoints []string, dialTimeout time.Duration, root string, security *tls.Config) (*Client, error) {
cli, err := clientv3.New(clientv3.Config{
Endpoints: endpoints,
DialTimeout: dialTimeout,
TLS: security,
Endpoints: endpoints,
DialTimeout: dialTimeout,
TLS: security,
AutoSyncInterval: 30 * time.Second,
})
if err != nil {
return nil, errors.Trace(err)
Expand Down

0 comments on commit 3621449

Please sign in to comment.