Skip to content

Commit

Permalink
Merge pull request #102 from bgokden/develop
Browse files Browse the repository at this point in the history
If there is connection there is hope.
  • Loading branch information
bgokden authored Aug 10, 2021
2 parents fc8371c + 0c620e3 commit b1464fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/connpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ func (cp *ConnectionPool) GetWithRetry(count int) *Connection {
}
if conn, ok := connectionInterface.(*Connection); ok {
if conn != nil && conn.Conn != nil {
if conn.Conn.GetState() == connectivity.Ready || conn.Conn.GetState() == connectivity.Connecting {
if conn.Conn.GetState() != connectivity.Shutdown {
return conn
} else {
err := conn.Conn.Close()
if err != nil {
log.Printf("Connection Close Error: %v\n", err.Error())
log.Printf("Connection Close Error (expected to be already closed): %v\n", err.Error())
}

}
Expand Down

0 comments on commit b1464fa

Please sign in to comment.