Azure Chrono 触发器表示法不起作用

Azure Chrono Trigger Notation Not Working

我正尝试在晚上 11 点、中午 12 点、凌晨 1 点、凌晨 2 点、凌晨 3 点和凌晨 4 点为 运行 Azure 函数创建计时触发器。我使用以下表示法:0 0 23,0,1,2,3,4 * * * 但我的函数从不 运行s.

我已将其更改为不同的个人时间,例如 0 0 23 * * *0 0 1 * * *,一切正常。

我注意到的另一个奇怪行为是,当我将其更改为 0 0 23-3 * * * 时,我的函数每小时 运行 超出范围 23HR-03HR。

有谁知道可能导致此行为的原因是什么? Azure 中从一天到下一天的时间范围是否存在问题?

Could there be an issue with time ranges in Azure wrapping from one day into the next?

不支持超过午夜的时间范围,并以相反的方式解释。

Azure Functions 使用 NCronTab library to interpret NCRONTAB expressions. Checking its issues, I found ranges that cross over midnight and Hour semantics.

Is it possible to provide a range that crosses over midnight (e.g. 21-5)?
No, that's the same as 5-21.

未测试,但如果使用符号 0 0 0,1,2,3,4,23 * * * 会怎样?

您可以将值 23 与范围 0-4 组合起来,如下所示:

0 0 23,0-4 * * *

正如@rickvdbosch 在他们的回答中所述,Azure Functions 使用 NCronTab 来解释 cron 表达式。您可以使用一些网站来测试 NCronTab 表达式,例如 https://ncrontab.swimburger.net/.