Commit 193a696a authored by wei.xuan's avatar wei.xuan

fix:fix reconnect

parent cf26b5e7
...@@ -152,7 +152,7 @@ func (c *client) dialTCP() Session { ...@@ -152,7 +152,7 @@ func (c *client) dialTCP() Session {
} }
log.Warnf("net.DialTimeout(addr:%s, timeout:%v) = error:%+v", c.addr, connectTimeout, err) log.Warnf("net.DialTimeout(addr:%s, timeout:%v) = error:%+v", c.addr, connectTimeout, err)
<-gxtime.After(time.Second) <-gxtime.After(time.Millisecond * time.Duration(c.reconnectInterval))
} }
} }
...@@ -424,7 +424,9 @@ func (c *client) reConnect() { ...@@ -424,7 +424,9 @@ func (c *client) reConnect() {
if maxTimes < times { if maxTimes < times {
times = maxTimes times = maxTimes
} }
<-gxtime.After(time.Duration(int64(times) * int64(interval))) rinterval := time.Duration(int64(times) * int64(interval))
log.Infof("reConnect %+v", rinterval)
<-gxtime.After(rinterval)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment