conn.destroy(); });
/** * Disconnect mysql. This is done automatically, so shouldn't need to be manually called. * @param bool graceful - force close? * @returns {Promise} */ disconnect(graceful=true){ return new Promise((resolve, reject)=>{ if(!this._conn){ resolve(); return; } if(graceful){ this._conn.end(err=>{ if(err){ reject(err); return; } this._conn = null; resolve(); }); }else{ this._conn.destroy(); resolve(); } }); }
}); connection.destroy(); }.bind(this));