Skip to content

Commit cc5c1bb

Browse files
committed
implement scheduling mechanism
1 parent ed615cb commit cc5c1bb

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

dags/fetch_notices_by_date.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
from airflow.decorators import dag, task
44
from airflow.operators.dummy import DummyOperator
55
from airflow.operators.python import BranchPythonOperator, PythonOperator
6-
from airflow.utils.trigger_rule import TriggerRule
76
from airflow.timetables.trigger import CronTriggerTimetable
7+
from airflow.utils.trigger_rule import TriggerRule
88

99
from dags import DEFAULT_DAG_ARGUMENTS
1010
from dags.dags_utils import get_dag_param, push_dag_downstream, pull_dag_upstream
1111
from dags.operators.DagBatchPipelineOperator import NOTICE_IDS_KEY, TriggerNoticeBatchPipelineOperator
1212
from dags.pipelines.notice_fetcher_pipelines import notice_fetcher_by_date_pipeline
13+
from ted_sws import config
1314
from ted_sws.event_manager.adapters.event_log_decorator import event_log
1415
from ted_sws.event_manager.model.event_message import TechnicalEventMessage, EventMessageMetadata, \
1516
EventMessageProcessType
@@ -27,9 +28,13 @@
2728

2829
DAG_FETCH_DEFAULT_TIMEZONE = "UTC"
2930

31+
3032
@dag(default_args=DEFAULT_DAG_ARGUMENTS,
33+
dag_id=FETCHER_DAG_NAME,
3134
catchup=False,
32-
timetable=CronTriggerTimetable('0 1 * * *', timezone='UTC'),
35+
timetable=CronTriggerTimetable(
36+
cron=config.SCHEDULE_DAG_FETCH,
37+
timezone=DAG_FETCH_DEFAULT_TIMEZONE),
3338
tags=['selector', 'daily-fetch'])
3439
def fetch_notices_by_date():
3540
@task

0 commit comments

Comments
 (0)