Close implements the driver.Conn.Close method.
()
| 222 | |
| 223 | // Close implements the driver.Conn.Close method. |
| 224 | func (c *conn) Close() error { |
| 225 | // close the meta connection |
| 226 | if atomic.CompareAndSwapInt32(&c.closed, 0, 1) { |
| 227 | log.WithField("db", c.dbID).Debug("closed connection") |
| 228 | } |
| 229 | if c.leader != nil { |
| 230 | c.leader.close() |
| 231 | } |
| 232 | if c.follower != nil { |
| 233 | c.follower.close() |
| 234 | } |
| 235 | return nil |
| 236 | } |
| 237 | |
| 238 | // Begin implements the driver.Conn.Begin method. |
| 239 | func (c *conn) Begin() (driver.Tx, error) { |