style:change the declaration location ofreconnect-related variables
diff --git a/client.go b/client.go
index 3aa9be2..045c6e1 100644
--- a/client.go
+++ b/client.go
@@ -56,11 +56,6 @@
ignoreReconnectKey = "ignore-reconnect"
)
-var (
- num, max, times, interval int
- maxDuraion int64
-)
-
type Client interface {
EndPoint
}
@@ -428,6 +423,10 @@
// a for-loop connect to make sure the connection pool is valid
func (c *client) reConnect() {
+ var (
+ num, max, times, interval int
+ maxDuraion int64
+ )
max = c.number
interval = c.reconnectInterval
if interval == 0 {
@@ -440,7 +439,7 @@
}
num = c.sessionNum()
- if max <= num || max < times {
+ if max <= num || max < times {
//Exit when the number of connection pools is sufficient or the reconnection times exceeds the connections numbers.
break
}