gpt4 book ai didi

azure - 长时间运行的计划 WebJob 被 Azure 中止

转载 作者:行者123 更新时间:2023-12-03 03:08:57 24 4
gpt4 key购买 nike

我在 Azure WebApp 上有一个 Azure 计划 Web 作业。在 Web 作业中,它从 azure blob 下载 excel 文件并读取(文件中的 25 - 30 k 条记录),然后迭代循环以将记录插入数据库中。现在,当我们安排(安排时间:18 小时)第一次作业成功运行并处理文件中的所有记录时,没有任何中断(在站点访问期间)。但是,下次它会无缘无故地失败(中止)(没有人访问站点。可能处于空闲状态)。

WebJob Abort Status

当我查看日志时没有任何迹象。但是,第一个计划运行成功并显示成功状态,后来所有计划都处于 Aborted 状态,为什么?

Success

还在网络应用程序中完成以下设置:

stopping_wait_time - 3600
WEBJOBS_IDLE_TIMEOUT - 3600
SCM_COMMAND_IDLE_TIMEOUT - 121

最佳答案

Azure's documentation ,

Always On. By default, web apps are unloaded if they are idle for some period of time. This lets the system conserve resources. In Basic or Standard mode, you can enable Always On to keep the app loaded all the time. If your app runs continuous web jobs, you should enable Always On, or the web jobs may not run reliably.

因此,Azure Web Apps 不 promise 您的 WebJob 继续运行超过 20 分钟。如果您需要依赖它,则需要启用Always On。启用它。见下文。

  1. Azure Portal ,导航至您的应用服务。
  2. 点击“设置”菜单中的应用程序设置
  3. 始终开启开启,然后点击保存

这是图片:

enter image description here

如果您使用的是 Azure 免费套餐,也许此线程会对您有所帮助:How can I keep my Azure WebJob running without "Always On" .

关于azure - 长时间运行的计划 WebJob 被 Azure 中止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41457625/

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