mirror of
https://github.com/ansible/awx.git
synced 2026-05-17 06:17:36 -02:30
improve the check performed to determine if a job is in an active state
This commit is contained in:
@@ -151,12 +151,11 @@ function JobStatusService (moment, message) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.setJobStatus = status => {
|
this.setJobStatus = status => {
|
||||||
this.state.status = status;
|
const isExpectingStats = this.isExpectingStatsEvent();
|
||||||
|
|
||||||
const isIncomplete = _.includes(INCOMPLETE, status);
|
const isIncomplete = _.includes(INCOMPLETE, status);
|
||||||
const isFinished = _.includes(FINISHED, status);
|
const isFinished = _.includes(FINISHED, status);
|
||||||
|
|
||||||
if ((this.isExpectingStatsEvent() && isIncomplete) || isFinished) {
|
if ((isExpectingStats && isIncomplete) || (!isExpectingStats && isFinished)) {
|
||||||
if (this.latestTime) {
|
if (this.latestTime) {
|
||||||
this.setFinished(this.latestTime);
|
this.setFinished(this.latestTime);
|
||||||
if (!this.state.started && this.state.elapsed) {
|
if (!this.state.started && this.state.elapsed) {
|
||||||
@@ -166,6 +165,7 @@ function JobStatusService (moment, message) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.state.status = status;
|
||||||
this.updateRunningState();
|
this.updateRunningState();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user