Skip to content

Commit 8751133

Browse files
gsakkisFokko
authored andcommitted
[AIRFLOW-796] Add processor_poll_interval and num_runs to config (apache#5009)
1 parent 5c17948 commit 8751133

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

airflow/bin/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1995,7 +1995,7 @@ class CLIFactory(object):
19951995
'dag_id_opt': Arg(("-d", "--dag_id"), help="The id of the dag to run"),
19961996
'num_runs': Arg(
19971997
("-n", "--num_runs"),
1998-
default=-1, type=int,
1998+
default=conf.getint('scheduler', 'num_runs'), type=int,
19991999
help="Set the number of runs to execute before exiting"),
20002000
# worker
20012001
'do_pickle': Arg(

airflow/config_templates/default_airflow.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,13 @@ job_heartbeat_sec = 5
448448
# how often the scheduler should run (in seconds).
449449
scheduler_heartbeat_sec = 5
450450

451+
# The number of times to try to schedule each DAG file
452+
# -1 indicates unlimited number
453+
num_runs = -1
454+
455+
# The number of seconds to wait between consecutive DAG file processing
456+
processor_poll_interval = 1
457+
451458
# after how much time (seconds) a new DAGs should be picked up from the filesystem
452459
min_file_process_interval = 0
453460

airflow/jobs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,8 @@ def __init__(
548548
dag_id=None,
549549
dag_ids=None,
550550
subdir=settings.DAGS_FOLDER,
551-
num_runs=-1,
552-
processor_poll_interval=1.0,
551+
num_runs=conf.getint('scheduler', 'num_runs'),
552+
processor_poll_interval=conf.getfloat('scheduler', 'processor_poll_interval'),
553553
do_pickle=False,
554554
log=None,
555555
*args, **kwargs):

0 commit comments

Comments
 (0)