From 9da14bc69ec00f8cccbf9c4cc6f22c93a8564dbe Mon Sep 17 00:00:00 2001 From: welefen Date: Tue, 16 Aug 2016 11:51:38 +0800 Subject: [PATCH] Add close event for mysql socket --- src/adapter/socket/mysql.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/adapter/socket/mysql.js b/src/adapter/socket/mysql.js index 37c243ea..37151b85 100644 --- a/src/adapter/socket/mysql.js +++ b/src/adapter/socket/mysql.js @@ -93,6 +93,9 @@ export default class extends Base { this.connection.on('error', () => { this.close(); }); + this.connection.on('close', () => { + this.close(); + }); //PROTOCOL_CONNECTION_LOST this.connection.on('end', () => { this.connection = null;