在我的nodejs服务器中,我正在向AWS(python flask Server)发送发布请求,AWS服务器将花费大约30分钟来处理数据(因为它运行了某些ML代码)并响应 这是执行超时的正确方法吗?因为它似乎不起作用。
const awsResponse = await axios.post(`${process.env.AWS_PUBLIC_IP}/aws`, data,
{ timeout: 1800000 } // 30 minutes
);
(编辑)
我遇到的错误是..
Error: Request failed with status code 502
AWS Error Response: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>502 Proxy Error</title>
</head><body>
<h1>Proxy Error</h1>
<p>The proxy server received an invalid
response from an upstream server.<br />
The proxy server could not handle the request<p>Reason: <strong>Error reading from remote server</strong></p></p>
</body></html>
)。 正如上面参考中指出的那样,如果服务器的超时配置短于客户端的超时设置,则客户端超时设置无关紧要。