You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/06/15 08:16:57 UTC

[GitHub] [airflow] fuyi commented on a change in pull request #8675: show correct duration on graph view for running task (#8311)

fuyi commented on a change in pull request #8675:
URL: https://github.com/apache/airflow/pull/8675#discussion_r440004656



##########
File path: airflow/www/static/js/task-instances.js
##########
@@ -20,12 +20,18 @@
 /* global window, dagTZ, moment, convertSecsToHumanReadable */
 
 // We don't re-import moment again, otherwise webpack will include it twice in the bundle!
-import { defaultFormat, formatDateTime } from './datetime-utils';
 import { escapeHtml } from './base';
+import { defaultFormat, formatDateTime } from './datetime-utils';
 
 function makeDateTimeHTML(start, end) {
+  // check task ended or not
+  if (end && end instanceof moment) {
+    return (
+      `Started: ${start.format(defaultFormat)} <br> Ended: ${end.format(defaultFormat)} <br>`
+    )
+  }
   return (
-    `Started: ${start.format(defaultFormat)} <br> Ended: ${end.format(defaultFormat)} <br>`
+    `Started: ${start.format(defaultFormat)} <br> Ended: Not ended yet <br>`

Review comment:
       Thanks for the comment @feluelle. However, I think it is more informative to keep `Ended: Not ended yet`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org