为什么我的Azure触发的WebJob永远不会成功运行?

发布于 2025-02-05 04:46:50 字数 518 浏览 4 评论 0原文

我有几个azure webjobs完成完成,一旦完成我的业务逻辑,我称等待StopAsync(stoppingtoken);

但是,Azure Portal继续显示其状态为“运行”,直到作业最终终止了作业默认120秒后超时。

我该如何正确告诉Azure Portal/Kudu,实际上这项工作已经完成?

这是一个显示问题的示例:

namespace MyService
{
    public class MyService : BackgroundService
    {
        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
        {
            // same issue whether or not I call this:
            await StopAsync(stoppingToken);
        }
    }
}

I have a few Azure WebJobs that run to completion, once my business logic is done I call await StopAsync(stoppingToken);

However, Azure Portal continues to show their status as "Running" until eventually the jobs terminated after the default 120 second timeout.

How can I correctly tell Azure Portal/Kudu that the job is in fact finished?

Here is an example that shows the issue:

namespace MyService
{
    public class MyService : BackgroundService
    {
        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
        {
            // same issue whether or not I call this:
            await StopAsync(stoppingToken);
        }
    }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

善良天后 2025-02-12 04:46:50

在发布此问题的一周后,我的工作现在即使没有进行任何更改,现在仍在神秘地完成,我认为Microsoft的某人在他们的尽头修复了一些问题。

A week after posting this question my jobs are now mysteriously completing successfully even though no changes were made, I assume someone at Microsoft fixed something on their end.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文