简体   繁体   English

超时 Azure Function 如果触发其他 azure ZC1C425268E68385D1AB507ZF4C17

[英]Timeout Azure Function if trigger other azure function

I am new Azure function.我是新 Azure function。 I want to call the Azure function which will trigger another Azure function.我想打电话给 Azure function 这将触发另一个 Azure ZC1C425250768E683A794F1CAB4 I have written bellow code but its giving me timeout.我写了下面的代码,但它给了我超时。 The code written in node js.用 node js 编写的代码。 Please suggest what to do.请建议该怎么做。

 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
    };


};

Your code logic may be stuck at some point, so it gives you timeout.(Azure function has a default timeout limit.) I think the function chain of azure durable function fully meets your requirements, and you are using nodejs, so azure durable function is supported. Your code logic may be stuck at some point, so it gives you timeout.(Azure function has a default timeout limit.) I think the function chain of azure durable function fully meets your requirements, and you are using nodejs, so azure durable function支持。

Please have a look of this:请看一下:

https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-sequence?tabs=javascript https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-sequence?tabs=javascript

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Microsoft Azure Web聊天,通过其他功能触发麦克风 - Microsoft Azure Web Chat, trigger mic from other function Azure持久函数的活动函数中的超时 - Timeout in an Activity Function of Azure Durable Functions Azure Function 达到超时而不做任何事情 - Azure Function reaching timeout without doing anything Azure Function App TimmerTrigger 执行时超时错误 - Azure Function App TimmerTrigger Timeout error on execution 如何使用 Cosmos DB 触发器构建 Azure 函数? - How to build an Azure Function with Cosmos DB Trigger? HTTP触发器上的Azure Function App jsreport不起作用 - Azure Function App jsreport on HTTP trigger not working Azure function 触发器与物联网中心“EntityPath” - Azure function trigger with IoT-Hub "EntityPath" JSON 作为 Javascript object 在 Azure http 触发器 function - JSON as Javascript object in Azure http trigger function 如何使用自定义错误响应在azure函数http触发器中触发失败 - How to trigger a failure in an azure function http trigger, WITH a custom error response Azure函数在中途重新启动,然后再也不返回(HTTP触发器) - Azure function restarts midway then never returns (HTTP Trigger)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM