Skip to content

Commit

Permalink
linter: check AutoSyncInterval for etcd config (#44081) (#44097)
Browse files Browse the repository at this point in the history
close #42643
  • Loading branch information
ti-chi-bot authored Jun 29, 2023
1 parent afd7584 commit 83d2d98
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions dumpling/export/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ func getPdDDLIDs(pCtx context.Context, cli *clientv3.Client) ([]string, error) {

func checkSameCluster(tctx *tcontext.Context, db *sql.DB, pdAddrs []string) (bool, error) {
cli, err := clientv3.New(clientv3.Config{
Endpoints: pdAddrs,
DialTimeout: defaultEtcdDialTimeOut,
Endpoints: pdAddrs,
DialTimeout: defaultEtcdDialTimeOut,
AutoSyncInterval: 30 * time.Second,
})
if err != nil {
return false, errors.Trace(err)
Expand Down
7 changes: 4 additions & 3 deletions util/etcd/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,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 83d2d98

Please sign in to comment.