Skip to content

Commit

Permalink
feat: disable endpoints check when only one address is provided (#175)
Browse files Browse the repository at this point in the history
Signed-off-by: ZhangJian He <[email protected]>
  • Loading branch information
shoothzj authored Sep 11, 2024
1 parent baf8764 commit a55fca5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion opengemini/client_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ func newClient(c *Config) (Client, error) {
batchContextCancel: cancel,
}
dbClient.prevIdx.Store(-1)
go dbClient.endpointsCheck(ctx)
if len(c.Addresses) > 1 {
// if there are multiple addresses, start the health check
go dbClient.endpointsCheck(ctx)
}
return dbClient, nil
}

Expand Down

0 comments on commit a55fca5

Please sign in to comment.