Created
September 28, 2017 18:31
-
-
Save aaronpolhamus/4616738f353093d8bdd84b057e0fa1fe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
from airflow.models import DAG | |
from airflow.operators.python_operator import PythonOperator | |
DAG = DAG( | |
dag_id='scheduler_test_dag', | |
start_date=datetime(2017, 9, 9, 4, 0, 0, 0), #..EC2 time. Equal to 11pm hora México | |
max_active_runs=1, | |
schedule_interval='*/1 * * * *' #..ever minute | |
) | |
def ticker_function(): | |
with open('/tmp/ticker', 'a') as outfile: | |
outfile.write('{}\n'.format(datetime.now())) | |
time_ticker = PythonOperator( | |
task_id='time_ticker', | |
python_callable=ticker_function, | |
dag=DAG | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment