feng-tao closed pull request #3899: [AIRFLOW-3004] Add config disabling
scheduler cron
URL: https://github.com/apache/incubator-airflow/pull/3899
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/airflow/config_templates/default_airflow.cfg
b/airflow/config_templates/default_airflow.cfg
index 000dd67a13..e71b7fda5d 100644
--- a/airflow/config_templates/default_airflow.cfg
+++ b/airflow/config_templates/default_airflow.cfg
@@ -484,6 +484,10 @@ max_threads = 2
authenticate = False
+# Turn off scheduler use of cron intervals by setting this to False.
+# DAGs submitted manually in the web UI or with trigger_dag will still run.
+use_job_schedule = True
+
[ldap]
# set this to ldaps://<your.ldap.server>:<port>
uri =
diff --git a/airflow/jobs.py b/airflow/jobs.py
index 916ec1f243..78b9baa4f5 100644
--- a/airflow/jobs.py
+++ b/airflow/jobs.py
@@ -785,7 +785,7 @@ def create_dag_run(self, dag, session=None):
for a DAG based on scheduling interval
Returns DagRun if one is scheduled. Otherwise returns None.
"""
- if dag.schedule_interval:
+ if dag.schedule_interval and conf.getboolean('scheduler',
'USE_JOB_SCHEDULE'):
active_runs = DagRun.find(
dag_id=dag.dag_id,
state=State.RUNNING,
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services