From 89e08460dd72ed719814dce4e7f8c7087d15dd17 Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Tue, 22 May 2018 13:57:37 -0400 Subject: [PATCH] display client finish time for incomplete job statuses --- awx/ui/client/features/output/status.service.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/awx/ui/client/features/output/status.service.js b/awx/ui/client/features/output/status.service.js index 704d87ed18..4c92f4d598 100644 --- a/awx/ui/client/features/output/status.service.js +++ b/awx/ui/client/features/output/status.service.js @@ -107,10 +107,8 @@ function JobStatusService (moment, message) { } }; - this.isExpectingStatsEvent = () => ( - (this.jobType === 'job') || - (this.jobType === 'project_update')) && - (!_.includes(INCOMPLETE, this.state.status)); + this.isExpectingStatsEvent = () => (this.jobType === 'job') || + (this.jobType === 'project_update'); this.updateStats = () => { this.updateHostCounts(); @@ -155,7 +153,10 @@ function JobStatusService (moment, message) { this.setJobStatus = status => { this.state.status = status; - if (!this.isExpectingStatsEvent() && _.includes(FINISHED, status)) { + const isIncomplete = _.includes(INCOMPLETE, status); + const isFinished = _.includes(FINISHED, status); + + if ((this.isExpectingStatsEvent() && isIncomplete) || isFinished) { if (this.latestTime) { this.setFinished(this.latestTime); if (!this.state.started && this.state.elapsed) {