Tag: 立交桥

使用pipe道节点请求阻止交换机api上的504网关超时

我使用以下代码进行OpenStreetMap查询(overpass-API)。 它在较小的查询上正常工作,但在较大的查询上工作正常,大约需要10分钟,它仅生成504网关超时响应。 码: var reqStr = "http://overpass.osm.rambler.ru/cgi/interpreter?data=… console.time("query"); var stream = request(reqStr,{timeout: 3600000}).on('error', function(err) { console.log(err) }).pipe(fs.createWriteStream('resultExport.json')); stream.on('finish', function () { console.timeEnd("query"); }); 响应(resultExport.json): <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>504 Gateway Time-out</title> </head><body> <h1>Gateway Time-out</h1> <p>The gateway did not receive a timely response from the upstream server or application.</p> </body></html> 查询命令有一个[timeout:3600] (秒),请求得到了{timeout:3600000} (毫秒)。 […]