【发布时间】:2022-08-02 17:31:35
【问题描述】:
我有一个使用 axios 调用 3rd 方 API 的 lambda 函数,当它调用 3rd 方 API 时,它会在他们的数据库上创建一个新条目,它工作正常但 lambda 函数正在返回503服务不可用
以下是我的代码 -
let algcon = {
method: \'post\',
url: constants.API_URL,
timeout: 1000 * 7,
headers: {
\'Content-Type\': \'application/json\',
\"User-Agent\": \"axios 0.21.1\",
\'token\': myToken ? JSON.stringify(myToken.access) : \'\'
},
data: invoiceData,
};
await axios(algcon).then(function (response) {
}).catch(function (error) {
console.log(error) //here it is throwing 503 service unavailable error
});
我增加了 lambda 执行时间,但仍然出现相同的错误。请帮忙!!
标签: node.js aws-lambda axios