[ 
https://issues.apache.org/jira/browse/AIRFLOW-3004?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16637558#comment-16637558
 ] 

ASF GitHub Bot commented on AIRFLOW-3004:
-----------------------------------------

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]


> Add configuration option to disable schedules
> ---------------------------------------------
>
>                 Key: AIRFLOW-3004
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-3004
>             Project: Apache Airflow
>          Issue Type: Improvement
>          Components: configuration, scheduler
>            Reporter: Jacob Greenfield
>            Assignee: Jacob Greenfield
>            Priority: Minor
>
> We have a particular use case where we'd like there to be a configuration 
> option that controls the scheduler and prevents use of the cron schedules 
> globally for all DAGs, while still allowing manual submission (trigger_dag) 
> and task instances being scheduled.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to