Skip to content

Commit

Permalink
Merge pull request #123 from idealista/fix/optional_scheduler_runs
Browse files Browse the repository at this point in the history
Optional SCHEDULER_RUNS use
  • Loading branch information
ultraheroe authored Apr 14, 2023
2 parents aefce72 + ce55367 commit 96c68ce
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog).

## [Unreleased](https://github.com/idealista/airflow-role/tree/develop)

## [2.0.7](https://github.com/idealista/airflow-role/tree/2.0.7)

[Full Changelog](https://github.com/idealista/airflow-role/compare/2.0.6...2.0.7)

### Fixed
- #114 The "-n" option might not be needed

## [2.0.6](https://github.com/idealista/airflow-role/tree/2.0.6)

[Full Changelog](https://github.com/idealista/airflow-role/compare/2.0.5...2.0.6)

### Fixed
- :hammer_and_wrench: Allow intalling only some services
- :hammer_and_wrench: Updating travis environment
Expand Down
2 changes: 1 addition & 1 deletion defaults/main/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ airflow_admin_users:
# email:

# Service options
airflow_scheduler_runs: 1000
# airflow_scheduler_runs: 1000
airflow_private_tmp: false

airflow_services:
Expand Down
2 changes: 2 additions & 0 deletions templates/airflow-environment-file.j2
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
#

# required setting, 0 sets it to unlimited. Scheduler will get restart after every X runs
{% if airflow_scheduler_runs is defined %}
SCHEDULER_RUNS={{ airflow_scheduler_runs }}
{% endif %}

AIRFLOW_HOME={{ airflow_app_home }}
AIRFLOW_CONFIG={{ airflow_conf_path }}/airflow.cfg
Expand Down
2 changes: 2 additions & 0 deletions templates/airflow-profile.d-file.j2
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
# AIRFLOW_HOME=
#
# required setting, 0 sets it to unlimited. Scheduler will get restart after every X runs
{% if airflow_scheduler_runs is defined %}
export SCHEDULER_RUNS={{ airflow_scheduler_runs }}
{% endif %}

if [ -d "{{ airflow_app_home }}/bin" ] ; then
export PATH="{{ airflow_app_home }}/bin:$PATH"
Expand Down
2 changes: 1 addition & 1 deletion templates/airflow-scheduler.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ EnvironmentFile={{ airflow_environment_file_folder }}/airflow
User={{ airflow_user }}
Group={{ airflow_group }}
Type=simple
ExecStart={{ airflow_executable }} scheduler -n ${SCHEDULER_RUNS} --pid {{ airflow_pidfile_folder }}-scheduler/scheduler.pid
ExecStart={{ airflow_executable }} scheduler {% if airflow_scheduler_runs is defined %}-n ${SCHEDULER_RUNS} {% endif %}--pid {{ airflow_pidfile_folder }}-scheduler/scheduler.pid
KillSignal=SIGINT
Restart=always
RestartSec=5s
Expand Down

0 comments on commit 96c68ce

Please sign in to comment.