Skip to content

Commit 7be2827

Browse files
committed
add a warning message, when pvnet fails
1 parent 3f5a894 commit 7be2827

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

terraform/modules/services/airflow/dags/uk/forecast-gsp-dag.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from datetime import datetime, timedelta, timezone
33
from airflow import DAG
44
from airflow.providers.amazon.aws.operators.ecs import EcsRunTaskOperator
5+
from airflow.providers.slack.notifications.slack import send_slack_notification
56
from utils.slack import on_failure_callback
67

78
from airflow.operators.latest_only import LatestOnlyOperator
@@ -52,7 +53,13 @@
5253
},
5354
},
5455
task_concurrency=10,
55-
on_failure_callback=on_failure_callback,
56+
on_failure_callback=[send_slack_notification(
57+
text="⚠️ The task {{ ti.task_id }} failed,"
58+
" but its ok. PVNET-ECMWF only will run next. "
59+
"No out of hours support is required. ⚠️",
60+
channel=f"tech-ops-airflow-{env}",
61+
username="Airflow",
62+
)],
5663
awslogs_group="/aws/ecs/forecast/forecast_pvnet",
5764
awslogs_stream_prefix="streaming/forecast_pvnet-forecast",
5865
awslogs_region="eu-west-1",

0 commit comments

Comments
 (0)