close socket when has error Connection lost: The server closed the connection.

This commit is contained in:
lichengyin 2015-11-16 09:44:37 +08:00
parent 0225d468a2
commit 4d4596ef3b

View File

@ -124,6 +124,10 @@ export default class extends Base {
if(this.pool && connection.release){
connection.release();
}
//Connection lost: The server closed the connection.
if(err.code === 'PROTOCOL_CONNECTION_LOST'){
this.close();
}
if (this.config.log_sql) {
think.log(sql, 'SQL', startTime);