如何在 node.js 中为 mysql 查询设置超时?
/*...*/
var mysql = require("mysql");
/* ...*/
app.get("/", function(req, res) {
connection.query("SELECT ...", function(err, rows, fields) {
/* I want this query to fail if the ^_ callback is not invoked within x seconds */
});
}