Shutdown is used to close the connection pool
()
| 146 | |
| 147 | // Shutdown is used to close the connection pool |
| 148 | func (p *connPool) Shutdown() error { |
| 149 | p.Lock() |
| 150 | defer p.Unlock() |
| 151 | |
| 152 | for _, conn := range p.pool { |
| 153 | conn.Close() |
| 154 | } |
| 155 | p.pool = make(map[string]*conn) |
| 156 | |
| 157 | if p.shutdown { |
| 158 | return nil |
| 159 | } |
| 160 | p.shutdown = true |
| 161 | close(p.shutdownCh) |
| 162 | return nil |
| 163 | } |
| 164 | |
| 165 | // Acquire is used to get a connection that is pooled or to return a new |
| 166 | // connection |
no test coverage detected