Skip to content

Commit

Permalink
style:调整代码注释
Browse files Browse the repository at this point in the history
  • Loading branch information
No-SilverBullet committed Apr 17, 2024
1 parent 4cbf2c1 commit d3f5be3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ var (
ignoreReconnectKey = "ignore-reconnect"
)

var (
num, max, times, interval int
maxDuraion int64
)
type Client interface {
EndPoint
}
Expand Down Expand Up @@ -423,8 +427,6 @@ func (c *client) RunEventLoop(newSession NewSessionCallback) {

// a for-loop connect to make sure the connection pool is valid
func (c *client) reConnect() {
var num, max, times, interval int
var maxDuraion int64
max = c.number
interval = c.reconnectInterval
if interval == 0 {
Expand All @@ -437,7 +439,8 @@ func (c *client) reConnect() {
}

num = c.sessionNum()
if max <= num || max < times { //Exit when the number of connection pools is sufficient or the reconnection times exceeds the connections numbers.
if max <= num || max < times {
//Exit when the number of connection pools is sufficient or the reconnection times exceeds the connections numbers.
break
}
c.connect()
Expand Down

0 comments on commit d3f5be3

Please sign in to comment.