Skip to content

Commit 3621449

Browse files
authored
*: add auto sync configuration in creating etcd client (#1240)
close #1236
1 parent f883b1e commit 3621449

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/etcd/etcd.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ func NewClient(cli *clientv3.Client, root string) *Client {
4747
// NewClientFromCfg returns a wrapped etcd client
4848
func NewClientFromCfg(endpoints []string, dialTimeout time.Duration, root string, security *tls.Config) (*Client, error) {
4949
cli, err := clientv3.New(clientv3.Config{
50-
Endpoints: endpoints,
51-
DialTimeout: dialTimeout,
52-
TLS: security,
50+
Endpoints: endpoints,
51+
DialTimeout: dialTimeout,
52+
TLS: security,
53+
AutoSyncInterval: 30 * time.Second,
5354
})
5455
if err != nil {
5556
return nil, errors.Trace(err)

0 commit comments

Comments
 (0)