Node.js – mysql查询超时
如何在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 */ }); }
我build议你看看这个链接:
http://www.exratione.com/2013/01/nodejs-connections-will-end-close-and-otherwise-blow-up/
但目前这个模块似乎没有任何支持。