气流:更改气流中DAG的crontab时间 [英] Airflow: changing the crontab time for a DAG in Airflow

查看:158
本文介绍了气流:更改气流中DAG的crontab时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个DAG,它每天3:00都在运行,过去几周运行良好。

I have a DAG that has been running everyday at 3:00, it ran OK for the past few weeks.

我已将日期更新为现在的7:00,但显然在过去的两天内没有运行。我可以看到这两天的任务处于正在运行状态(绿色),但未触发任何命令。

I've updated the date to run now at 7:00, but apparently for the last 2 days it didn't run. I can see the tasks for those two days with the status 'running' (in green), but no command is triggered.

有人需要做更多的事情来改变DAG的运行时间吗?

Does one needs to do something more to change de running time of a DAG ?

我知道解决此问题的过去一种方法是在元数据库中清理此DAG的任务,并更新start_date,但我宁愿避免再次执行此操作。

I know that in the past one way to solve this was to clean in the meta-database the tasks for this DAG, and update the start_date, but I would rather avoid doing this again.

有人提出建议吗?

推荐答案

要安排一次故障,Airflow只会查找最后一个执行日期加上计划时间间隔。如果这段时间到期,它将运行dag。您不能简单地更新开始日期。
一种简单的方法是编辑您的开始日期计划时间间隔,重命名dag(例如xxxx_v2.py)并重新部署。

To schedule a dag, Airflow just looks for the last execution date and sum the schedule interval. If this time has expired it will run the dag. You cannot simple update the start date. A simple way to do this is edit your start date and schedule interval, rename your dag (e.g. xxxx_v2.py) and redeploy it.

这篇关于气流:更改气流中DAG的crontab时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆