Skip to content

Commit

Permalink
util/conn: close old connection before reconnect (#982)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenbc committed May 15, 2020
1 parent 266ff8d commit 81a2d1f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions util/conn/manager.go
Expand Up @@ -117,6 +117,7 @@ func (m *Manager) loop() {
case err := <-m.putc:
if err != nil && conn != nil {
m.logger.Log("err", err)
conn.Close()
conn = nil // connection is bad
reconnectc = m.after(time.Nanosecond) // trigger immediately
}
Expand Down

0 comments on commit 81a2d1f

Please sign in to comment.