Skip to content

Commit 6ad3bc4

Browse files
sachin-arora-cashfreearorasachin9
authored andcommitted
apache#45037: Support for additional celery config directly from airflow.cfg file
1 parent ba49469 commit 6ad3bc4

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

chart/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2607,6 +2607,7 @@ config:
26072607
celery:
26082608
flower_url_prefix: '{{ ternary "" .Values.ingress.flower.path (eq .Values.ingress.flower.path "/") }}'
26092609
worker_concurrency: 16
2610+
extra_celery_config: '{}'
26102611
scheduler:
26112612
standalone_dag_processor: '{{ ternary "True" "False" .Values.dagProcessor.enabled }}'
26122613
# statsd params included for Airflow 1.10 backward compatibility; moved to [metrics] in 2.0

providers/src/airflow/providers/celery/executors/default_celery.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ def _broker_supports_visibility_timeout(url):
6969
log.debug("Value for celery result_backend not found. Using sql_alchemy_conn with db+ prefix.")
7070
result_backend = f'db+{conf.get("database", "SQL_ALCHEMY_CONN")}'
7171

72+
extra_celery_config: dict = conf.getjson("celery", "extra_celery_config", fallback={}) if conf.has_option("celery", "extra_celery_config") else {}
73+
7274
DEFAULT_CELERY_CONFIG = {
7375
"accept_content": ["json"],
7476
"event_serializer": "json",
@@ -85,6 +87,7 @@ def _broker_supports_visibility_timeout(url):
8587
),
8688
"worker_concurrency": conf.getint("celery", "WORKER_CONCURRENCY", fallback=16),
8789
"worker_enable_remote_control": conf.getboolean("celery", "worker_enable_remote_control", fallback=True),
90+
**extra_celery_config
8891
}
8992

9093

0 commit comments

Comments
 (0)