azure durable function 是否支持 cron 作业

does azure durable function support cron jobs

azure durable function 是否支持玉米作业。我需要一组任务 运行 每 5 分钟。在浏览 azure 持久函数的计时器部分时,没有看到任何为持久函数设置 cron 作业设置的示例

根据您的情况,您可以使用 normal Timer Triggers by Functions (not Durable). Or you can use Eternal Orchestrations that wake up periodically by Durable。

是和否,

Durable Functions 框架提供了一种方法运行 orchestrator 定期运行,参考下面的代码

await context.CallActivityAsync("DoCleanup", null);

// sleep for one hour between cleanups
DateTime nextCleanup = context.CurrentUtcDateTime.AddHours(1);
await context.CreateTimer(nextCleanup, CancellationToken.None);

context.ContinueAsNew(null);

以上代码将每小时调用您的 activity 函数 DoCleanup。

普通定时器触发器函数的问题是它们 运行 陷入了重叠问题。例如,如果你想 运行 每 1 分钟执行一次,如果你的函数执行需要 30 秒,那么你将面临重叠问题。

有了durable,上面的问题就解决了。保证不重叠。

唯一的问题是这个编排函数需要由一些持久的客户端从外部触发一次,不能像定时器触发 azure 函数那样自启动。

`