如何正确处理Apache Airflow中的夏时制?

编程入门 行业动态 更新时间:2024-10-26 23:31:37
本文介绍了如何正确处理Apache Airflow中的夏时制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在气流中,所有东西都应该是UTC(不受DST的影响)。

In airflow, everything is supposed to be UTC (which is not affected by DST).

但是,我们有工作流根据时区来传递信息。

However, we have workflows that deliver things based on time zones that are affected by DST.

一个示例方案:

  • 我们已安排工作东部时间的开始日期为8:00 AM,计划时间间隔为24小时。
  • 东部时间的每天上午8点,调度程序会发现距上次运行已经24小时了,
  • DST发生了,我们损失了一个小时。
  • 今天东部时间8点,调度员发现只有23个小时了,因为在机器上的时间是UTC,直到东部标准时间9AM才开始运行,这是一个延迟交货
  • We have a job scheduled with a start date at 8:00 AM Eastern and a schedule interval of 24 hours.
  • Everyday at 8 AM Eastern the scheduler sees that it has been 24 hours since the last run, and runs the job.
  • DST Happens and we lose an hour.
  • Today at 8 AM Eastern the scheduler sees that it has only been 23 hours because the time on the machine is UTC, and doesn't run the job until 9AM Eastern, which is a late delivery

有办法吗?安排dags,以便它们在时间更改后在正确的时间运行?

Is there a way to schedule dags so they run at the correct time after a time change?

推荐答案

此问题是在1.8版本的气流时被问到的.x。

This question was asked when airflow was on version 1.8.x.

此功能自ai以来已内置rflow 1.10。

This functionality is built-in now, as of airflow 1.10.

https:// airflow。 apache/timezone.html

在 airflow.cfg 中设置时区,并且dst应该是处理正确。

Set the timezone in airflow.cfg and dst should be handled correctly.

更多推荐

如何正确处理Apache Airflow中的夏时制?

本文发布于:2023-11-24 08:27:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1624473.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:夏时制   正确处理   Apache   Airflow

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!