This is an automated email from the ASF dual-hosted git repository.
bbovenzi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 6fa7b726d6 Use current time to calculate duration when end date is not
present. (#38375)
6fa7b726d6 is described below
commit 6fa7b726d6fcec6dd6fbf844a08d3fcff9e06711
Author: Karthikeyan Singaravelan <[email protected]>
AuthorDate: Thu Mar 21 22:01:48 2024 +0530
Use current time to calculate duration when end date is not present.
(#38375)
---
airflow/www/static/js/dag/details/dag/RunDurationChart.tsx | 4 +---
airflow/www/static/js/dag/details/task/TaskDuration.tsx | 2 +-
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/airflow/www/static/js/dag/details/dag/RunDurationChart.tsx
b/airflow/www/static/js/dag/details/dag/RunDurationChart.tsx
index d49fa26674..0c5c83c30b 100644
--- a/airflow/www/static/js/dag/details/dag/RunDurationChart.tsx
+++ b/airflow/www/static/js/dag/details/dag/RunDurationChart.tsx
@@ -62,9 +62,7 @@ const RunDurationChart = ({ showLandingTimes }: Props) => {
// @ts-ignore
const runDuration = moment.duration(
- dagRun.startDate && dagRun.endDate
- ? getDuration(dagRun.startDate, dagRun?.endDate)
- : 0
+ dagRun.startDate ? getDuration(dagRun.startDate, dagRun?.endDate) : 0
);
// @ts-ignore
diff --git a/airflow/www/static/js/dag/details/task/TaskDuration.tsx
b/airflow/www/static/js/dag/details/task/TaskDuration.tsx
index fadd79e18b..5b978189d3 100644
--- a/airflow/www/static/js/dag/details/task/TaskDuration.tsx
+++ b/airflow/www/static/js/dag/details/task/TaskDuration.tsx
@@ -62,7 +62,7 @@ const TaskDuration = () => {
if (!instance) return {};
// @ts-ignore
const runDuration = moment.duration(
- instance.startDate && instance.endDate
+ instance.startDate
? getDuration(instance.startDate, instance?.endDate)
: 0
);