Skip to content

Commit

Permalink
Move default timezone to except block (#34245)
Browse files Browse the repository at this point in the history
  • Loading branch information
hussein-awala committed Sep 9, 2023
1 parent 0ebac60 commit 7efc68c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions airflow/settings.py
Expand Up @@ -49,16 +49,15 @@

log = logging.getLogger(__name__)


TIMEZONE = pendulum.tz.timezone("UTC")
try:
tz = conf.get_mandatory_value("core", "default_timezone")
if tz == "system":
TIMEZONE = pendulum.tz.local_timezone()
else:
TIMEZONE = pendulum.tz.timezone(tz)
except Exception:
pass
TIMEZONE = pendulum.tz.timezone("UTC")

log.info("Configured default timezone %s", TIMEZONE)


Expand Down

0 comments on commit 7efc68c

Please sign in to comment.