gpt4 book ai didi

消费计划的 Azure 函数超时

转载 作者:行者123 更新时间:2023-12-02 07:40:26 24 4
gpt4 key购买 nike

我通过在 host.json 文件中指定以下内容,在我的 http 触发器 azure 函数 (v1) 上指定了超时

{
"functionTimeout": "00:10:00"
}

我已使用 VS2017 部署到 Azure,并且可以确认此设置现在显示在 Azure 门户中。为了确定起见,我还重新启动了函数应用程序。

当我执行函数时,即使超时已设置为 10 分钟,它总是会在 4 分钟左右超时

我已经排除了其他来源发生的超时,因为当我在本地测试 Azure 函数时,它不会超时。

谁能解释一下为什么会发生这种情况?

最佳答案

这是预料之中的。 Azure 站点上的 HTTP 请求有固定的超时设置。请参阅Azure Web App timeout setting of 230s 。在这方面,Azure Web 应用程序和 Http 触发器 Azure Function 没有区别。

There is a 230 second (i.e. a little less than 4 mins) timeout for requests that are not sending any data back. After that, the client gets the 500 you saw, even though in reality the request is allowed to continue server side.

至于如何绕过这个限制,如果不需要像httpresponse那样立即得到反馈,可以使用 queue trigger做好你的工作。

否则,请查看Durable function 。您可以发送 http 请求来启动协调器并获取启动成功的响应等等。工作正在协调器和事件函数中处理,我们不需要担心超时(因为它们也是非 http 触发器)。

关于消费计划的 Azure 函数超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53824034/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com