Skip to content

Commit ea67601

Browse files
committed
build(docker): add triggers into docker image and add airflow home as python path
1 parent ab5eb4a commit ea67601

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ ENV PYTHONPATH="${AIRFLOW_HOME}:$PYTHONPATH"
3838

3939
COPY airflow.cfg ${AIRFLOW_HOME}/airflow.cfg
4040
COPY --chown=airflow:root dags ${AIRFLOW_HOME}/dags
41+
COPY --chown=airflow:root triggers ${AIRFLOW_HOME}/triggers
4142
# TODO: remove this and the patch files once upgrade to 3.0.3
4243
COPY --chown=airflow:root patch/utils.py /app/.venv/lib/python3.10/site-packages/airflow/migrations/utils.py
4344
COPY --chown=airflow:root patch/versions /app/.venv/lib/python3.10/site-packages/airflow/migrations/versions

Dockerfile.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ ENV PYTHONPATH="${AIRFLOW_HOME}:$PYTHONPATH"
3838

3939
COPY airflow.cfg ${AIRFLOW_HOME}/airflow.cfg
4040
COPY --chown=airflow:root dags ${AIRFLOW_HOME}/dags
41+
COPY --chown=airflow:root triggers ${AIRFLOW_HOME}/triggers
4142
# TODO: remove this and the patch files once upgrade to 3.0.3
4243
COPY --chown=airflow:root patch/utils.py /app/.venv/lib/python3.10/site-packages/airflow/migrations/utils.py
4344
COPY --chown=airflow:root patch/versions /app/.venv/lib/python3.10/site-packages/airflow/migrations/versions

dags/app/discord.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
AssetWatcher(
1515
name="finance_report_watcher",
1616
trigger=FinanceReportTrigger(
17-
poke_interval=5, # 60*60*24
17+
poke_interval=86400, # 60*60*24
1818
),
1919
)
2020
],

triggers/finance_report.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ def serialize(self) -> tuple[str, dict[str, Any]]:
105105
async def run(self) -> AsyncIterator[TriggerEvent]:
106106
"""Loop until the finance report is updated."""
107107

108+
# TODO: improve it with asycn code
108109
while True:
109110
self.log.info("Checking Finance Report")
110-
# TODO: improve it with asycn code
111111
# read xls from google doc to df.
112112
df_xls = read_google_xls_to_df()
113113

0 commit comments

Comments
 (0)