气流CRON计划间隔无法正确触发DAG

发布于 2025-02-01 18:35:45 字数 704 浏览 5 评论 0原文

Airflow-version: **1.10.10** 

Cron: "30 07,08,11,15 * * *"  

DAG预计将以7:30,8:30,11:30,15:30运行 但是始终将DAG从11:30,15:30,19:30,20:30开始触发。 其中19:30,20:30在Cron表达中根本没有提及。

感谢有人帮助调试此问题。

代码:

CRON_SCHEDULER = "30 07,08,11,15 * * *" 
with DAG(
    "cron_test_dag",
    schedule_interval=CRON_SCHEDULER,
    start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
    catchup=False) as dag:
    start_job = DummyOperator(task_id='Start_Job', dag=dag)
    bash_task1 = BashOperator(
        task_id="bash_task1",
        bash_command="echo hello world",
        dag=dag,
    )
    start_job >> bash_task1
Airflow-version: **1.10.10** 

Cron: "30 07,08,11,15 * * *"  

The DAG is expected to run at 7:30, 8:30, 11:30, 15:30
but always DAG will start to trigger from 11:30, 15:30, 19:30, 20:30
where 19:30, 20:30 is not mentioned in cron expression at all.

Appreciate if anyone help to debug this issue.

code:

CRON_SCHEDULER = "30 07,08,11,15 * * *" 
with DAG(
    "cron_test_dag",
    schedule_interval=CRON_SCHEDULER,
    start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
    catchup=False) as dag:
    start_job = DummyOperator(task_id='Start_Job', dag=dag)
    bash_task1 = BashOperator(
        task_id="bash_task1",
        bash_command="echo hello world",
        dag=dag,
    )
    start_job >> bash_task1

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

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

发布评论

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

评论(2

跨年 2025-02-08 18:35:45

由于偏移量准确3个小时,我建议尝试更改您的时区。您是否按照您的代码建议在UTC时区?也许您应该将其更改为UTC+03。

As the offset is 3 hours exactly, I suggest trying to change your timezone. Are you in the UTC timezone as your code suggests? Maybe you should change it to UTC+03.

土豪我们做朋友吧 2025-02-08 18:35:45

19,20。

由于某种原因,

它将07,08解释为PM小时: 它带有几个版本。

我看不出任何与克罗纳类似问题的错误,所以我怀疑气流,但是我也看不到任何错误……

For some reason it is interpreting 07,08 as pm hours: 19, 20.

I've just tested with the latest version of croniter (used by airflow) and it seems to work as expected, nevertheless the leading 0.

I've tested it with several versions back.

I don't see any bug filed with similar problem to croniter, so I suspect Airflow, but I don't see any bug filed there either…

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