【发布时间】:2013-01-19 03:52:12
【问题描述】:
如何在 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 */
});
}
【问题讨论】: