1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

improve the check performed to determine if a job is in an active state

This commit is contained in:
Jake McDermott 2018-05-22 16:22:13 -04:00
parent 156b5e6979
commit 34dc939782
No known key found for this signature in database
GPG Key ID: 3B02CAD476EECB35

View File

@ -151,12 +151,11 @@ function JobStatusService (moment, message) {
};
this.setJobStatus = status => {
this.state.status = status;
const isExpectingStats = this.isExpectingStatsEvent();
const isIncomplete = _.includes(INCOMPLETE, status);
const isFinished = _.includes(FINISHED, status);
if ((this.isExpectingStatsEvent() && isIncomplete) || isFinished) {
if ((isExpectingStats && isIncomplete) || (!isExpectingStats && isFinished)) {
if (this.latestTime) {
this.setFinished(this.latestTime);
if (!this.state.started && this.state.elapsed) {
@ -166,6 +165,7 @@ function JobStatusService (moment, message) {
}
}
this.state.status = status;
this.updateRunningState();
};