gpt4 book ai didi

azure - 如何设置多个时间段的cron表达式

转载 作者:行者123 更新时间:2023-12-02 07:54:39 31 4
gpt4 key购买 nike

我需要每天上午 9 点和晚上 10.15 触发 cron 作业。即触发器将如下:

next today at 09:00:00
then today at 22:00:00
then today at 22:15:00
then next day at 09:00:00 and so on...

我已经这样做了 * 0,15 9,22 * * * 但它也会在上午 9.15 被触发,这是我不想要的。请帮我创建这个表达式。

如果这是不可能的,任何人都可以建议如何在时间触发的 azure 函数中编写多个 cron 表达式。这是我的代码:

[FunctionName("Function1")]
public void Run([TimerTrigger("* 0,15 9,22 * * *")] TimerInfo myTimer, ILogger log)
{
//my code here
}

最佳答案

据我所知,你不能在函数中创建这样的CRON表达式,我可以想到创建两个函数需要什么。一个函数 CRON 表达式:* 0 9,22 * *,另一个 CRON 表达式:* 15 22 * *

关于azure - 如何设置多个时间段的cron表达式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67970786/

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