|
|
|
@ -16,7 +16,8 @@ with DAG(
|
|
|
|
'daily_efficiency_api_calls',
|
|
|
|
'daily_efficiency_api_calls',
|
|
|
|
default_args=default_args,
|
|
|
|
default_args=default_args,
|
|
|
|
description='Efficiency API calls at specific times',
|
|
|
|
description='Efficiency API calls at specific times',
|
|
|
|
schedule_interval='30 0,8,15 * * *', # 07:30, 15:30, 22:30 GMT+7
|
|
|
|
# schedule_interval='30 0,8,15 * * *', # 07:30, 15:30, 22:30 GMT+7
|
|
|
|
|
|
|
|
schedule_interval='30 19,3,11 * * *', # 19:30, 03:30, 11:30 UTC
|
|
|
|
start_date=days_ago(1),
|
|
|
|
start_date=days_ago(1),
|
|
|
|
tags=['api', 'efficiency'],
|
|
|
|
tags=['api', 'efficiency'],
|
|
|
|
) as dag:
|
|
|
|
) as dag:
|
|
|
|
@ -29,18 +30,3 @@ with DAG(
|
|
|
|
method='GET',
|
|
|
|
method='GET',
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
# Afternoon call at 15:30 GMT+7 (08:30 UTC)
|
|
|
|
|
|
|
|
afternoon_api_call = SimpleHttpOperator(
|
|
|
|
|
|
|
|
task_id='afternoon_api_call',
|
|
|
|
|
|
|
|
http_conn_id='efficiency_api',
|
|
|
|
|
|
|
|
endpoint='efficiency/data/auto',
|
|
|
|
|
|
|
|
method='GET',
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Night call at 22:30 GMT+7 (15:30 UTC)
|
|
|
|
|
|
|
|
night_api_call = SimpleHttpOperator(
|
|
|
|
|
|
|
|
task_id='night_api_call',
|
|
|
|
|
|
|
|
http_conn_id='efficiency_api',
|
|
|
|
|
|
|
|
endpoint='efficiency/data/auto',
|
|
|
|
|
|
|
|
method='GET',
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|