不要怂,就是干,撸起袖子干!

Commit d60192fc by Dmitry Chornyi

Handle reconnects for MySQL read replicas with pooling

1 parent 3909a477
Showing with 10 additions and 0 deletions
......@@ -347,7 +347,17 @@ module.exports = (function() {
if (err.code !== 'PROTOCOL_CONNECTION_LOST') {
throw err
}
if (typeof(pool.destroy) == 'function') {
pool.destroy(client)
} else {
if (pool.read && typeof(pool.read.destroy) == 'function') {
pool.read.destroy(client)
}
if (pool.write && typeof(pool.write.destroy) == 'function') {
pool.write.destroy(client)
}
}
})
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!