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

Commit 63ac4704 by Dmitry Chornyi

Handle reconnects for MySQL read replicas with pooling

1 parent d60192fc
Showing with 2 additions and 2 deletions
...@@ -351,10 +351,10 @@ module.exports = (function() { ...@@ -351,10 +351,10 @@ module.exports = (function() {
if (typeof(pool.destroy) == 'function') { if (typeof(pool.destroy) == 'function') {
pool.destroy(client) pool.destroy(client)
} else { } else {
if (pool.read && typeof(pool.read.destroy) == 'function') { if (client.queryType == 'read' && pool.read && typeof(pool.read.destroy) == 'function') {
pool.read.destroy(client) pool.read.destroy(client)
} }
if (pool.write && typeof(pool.write.destroy) == 'function') { if (client.queryType == 'write' && pool.write && typeof(pool.write.destroy) == 'function') {
pool.write.destroy(client) 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!