gpt4 book ai didi

python - 多个 Azure Web 作业

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

我有一个 Azure 应用程序,我在其中托管 Web 作业。

每当我启动应用程序时,它只需 1 个 Webjob 就可以正常运行,并且一切正常。但随着时间的推移,突然出现了另一个 webjob,它是所需 webjob 的精确副本。

所以问题是,当未编码此功能时,会生成另一个 Webjob(不需要的)。

请参见图 1(必需/如开始时所示):

Please see Pic 1 (Required/ As is on Start)

请参见图 2(不需要/一段时间后发生):

Please see Pic 2 (Unwanted/ Happens After some time)

这是一个触发的网络作业,其 cron 计划为 * * * * * *

最佳答案

So the problem is that another webjob (unwanted) is spawned when thisfunctionality is not coded in.

我认为您的情况是由于执行时间段造成的。请检查doc中的以下声明:

In Azure environment, the scheduled webjob will only run on one instance (or worker). This is achieved by using file lock mechanism while the webjob is running. If the webjob happens to run for a very short time, there could be a race condition (such as clock sku) to cause another instance to later start up on the same schedule (since it detects no lock). The workaround is to make sure the webjob run for a certain period of time (say at least 5 seconds assuming schedule interval is greater).

另外,还有一个类似的案例供大家引用:Does Azure start up another instance of a scheduled web job if it is already running?

关于python - 多个 Azure Web 作业,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52373092/

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