Merge pull request #13068 from AlexSCorey/11555-CalculateElapsedTimeonJob

Allows job output to calculate elapsed time
This commit is contained in:
Sarah Akus
2022-10-21 11:51:47 -04:00
committed by GitHub
2 changed files with 37 additions and 14 deletions

View File

@@ -1305,6 +1305,8 @@ class UnifiedJob(
status_data['instance_group_name'] = None
elif status in ['successful', 'failed', 'canceled'] and self.finished:
status_data['finished'] = datetime.datetime.strftime(self.finished, "%Y-%m-%dT%H:%M:%S.%fZ")
elif status == 'running':
status_data['started'] = datetime.datetime.strftime(self.finished, "%Y-%m-%dT%H:%M:%S.%fZ")
status_data.update(self.websocket_emit_data())
status_data['group_name'] = 'jobs'
if getattr(self, 'unified_job_template_id', None):