Node.js 如果触发其他Azure函数,则Azure函数超时
我是新的Azure函数。我想调用Azure函数,它将触发另一个Azure函数。我已经写了下面的代码,但它给我超时。用NodeJS编写的代码。 请建议怎么做Node.js 如果触发其他Azure函数,则Azure函数超时,node.js,azure,timeout,azure-functions,Node.js,Azure,Timeout,Azure Functions,我是新的Azure函数。我想调用Azure函数,它将触发另一个Azure函数。我已经写了下面的代码,但它给我超时。用NodeJS编写的代码。 请建议怎么做 module.exports = async function (context, req, callback) { UtilityAccountNumber=req.body.UtilityAccountNumber.split(','); if(UtilityAccountNumber=='' || typeof Util
module.exports = async function (context, req, callback) {
UtilityAccountNumber=req.body.UtilityAccountNumber.split(',');
if(UtilityAccountNumber=='' || typeof UtilityAccountNumber==='undefined' || !(Array.isArray(UtilityAccountNumber) && UtilityAccountNumber.length) ){
response={
status: 0,
message:"Please provide utility acccount number."
};
else{
if(UtilityAccountNumber.length){
for(let accountNo of UtilityAccountNumber){
try
{
var options = {
host: process.env.API_HOST,
port: process.env.PORT,
path: '/api/'+process.env.WEBSCRAPERMASTER,
method: 'POST'
};
var myreq = http.request(options, function(res) {
});
myreq.end();
}
catch (ex) // if failed
{
await logHTTPErrorResponse(ex, huId);
console.error(ex);
}
}
}
}
context.res = {
status: 200,
body: response
};
};
您的代码逻辑可能会在某个点被卡住,因此它会给您超时。(Azure函数有一个默认的超时限制。)我认为Azure持久函数的功能链完全满足您的要求,并且您正在使用nodejs,因此Azure持久函数是受支持的 请看一下这个:
您的代码逻辑可能会在某个点被卡住,因此它会给您超时。(Azure函数有一个默认的超时限制。)我认为Azure持久函数的功能链完全满足您的要求,并且您正在使用nodejs,因此支持Azure持久函数 请看一下这个:
Azure函数中可能的最大超时时间为10分钟。您的用例听起来非常适合作为Azure函数扩展的持久函数。你已经看过了吗?如果没有,这些链接可能会有所帮助。开始使用持久功能-[还可以查看函数链接[Azure函数中可能的最大超时时间为10分钟。您的用例听起来非常适合作为Azure函数扩展的持久功能。您已经研究过它们了吗?如果没有,这些链接可能会有所帮助。开始使用持久功能-[还可以查看函数链接[