File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -1959,12 +1959,20 @@ def run_staled(self):
19591959 """Return True if the execution staled."""
19601960 return self .run_exitcode == 88
19611961
1962+ @property
1963+ def run_running (self ):
1964+ """Return True if the execution is running."""
1965+ return self .status == self .Status .RUNNING
1966+
19621967 @property
19631968 def execution_time (self ):
19641969 """Return the pipeline execution time."""
1965- if self .run_end_date and self .run_start_date :
1966- execution_time = (self .run_end_date - self .run_start_date ).total_seconds ()
1967- return humanize_time (execution_time )
1970+ if not self .run_start_date or (not self .run_end_date and not self .run_running ):
1971+ return
1972+
1973+ end_time = self .run_end_date or timezone .now ()
1974+ time_delta = (end_time - self .run_start_date ).total_seconds ()
1975+ return humanize_time (time_delta )
19681976
19691977 @property
19701978 def pipeline_url (self ):
You can’t perform that action at this time.
0 commit comments