Skip to content

Commit

Permalink
optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
mikechengwei committed Jan 24, 2022
1 parent 590785c commit 86c50fb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/manager/member/tidb_member_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,7 @@ func (m *tidbMemberManager) syncInitializer(tc *v1alpha1.TidbCluster) {
}
// init password
var db *sql.DB
var dsn string
dsn = util.GetDSN(tc)
dsn := util.GetDSN(tc)
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
db, err = util.OpenDB(ctx, dsn)
Expand Down

0 comments on commit 86c50fb

Please sign in to comment.