为什么我的Azure触发的WebJob永远不会成功运行?
我有几个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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在发布此问题的一周后,我的工作现在即使没有进行任何更改,现在仍在神秘地完成,我认为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.