我正在使用 promise-mysql
NodeJs 库对 MySQL 服务器进行等待操作。
目前我有一个简单的配置:
let pool = await mysql.createPool(dbConfig);
let connection = await pool.getConnection();
/// after the connection is made on the program start, once,
/// some querying using the connection follows
但是,似乎只有一个连接断开了。问题:如果当前连接断开,如何实现断开连接的自动处理并建立后续的新连接?