From a59963e8c1c8e5e8a4e4c792232ec6611c9df6cd Mon Sep 17 00:00:00 2001 From: Haresh Kainth Date: Fri, 6 Dec 2024 00:09:57 +0000 Subject: [PATCH] chore:set Celery to UTC and fix settings module path. Added UTC settings for Celery to ensure task scheduling consistency across environments. Corrected the DJANGO_SETTINGS_MODULE path for Celery configuration, aligning it with the project's structure. These changes help improve maintainability and prevent timezone-related issues. --- fbr/config/celery.py | 2 +- fbr/config/settings/base.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fbr/config/celery.py b/fbr/config/celery.py index cac99df..5bd82c7 100644 --- a/fbr/config/celery.py +++ b/fbr/config/celery.py @@ -4,7 +4,7 @@ from celery.schedules import crontab from dbt_copilot_python.celery_health_check import healthcheck -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fbr.config.settings.local") +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local") celery_app = Celery("fbr_celery") diff --git a/fbr/config/settings/base.py b/fbr/config/settings/base.py index 05b0b6c..194d8b0 100644 --- a/fbr/config/settings/base.py +++ b/fbr/config/settings/base.py @@ -155,6 +155,8 @@ CELERY_TASK_SOFT_TIME_LIMIT = ( 270 # Optional: Grace period before forced termination ) +CELERY_TIMEZONE = "UTC" +CELERY_ENABLE_UTC = True # Internationalisation LANGUAGE_CODE = "en-gb"