From ec8a452f1d6c424d143277ce4bb7169c76793541 Mon Sep 17 00:00:00 2001 From: kialam Date: Tue, 19 Feb 2019 13:40:37 -0500 Subject: [PATCH] Call `this.sync` when we receive a ws complete message. - There can be a race condition where a job run finishes event processing before sending off a "successful/failed" websocket message. In this instance, we would miss gathering known artifacts for a job. The proposed fix is to do a manual detection of when a job status updates to "successful/failed/unknown" and perform a GET request to the job endpoint. --- awx/ui/client/features/output/index.controller.js | 1 - awx/ui/client/features/output/status.service.js | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/features/output/index.controller.js b/awx/ui/client/features/output/index.controller.js index 51a4ba39ca..2f4a3e2575 100644 --- a/awx/ui/client/features/output/index.controller.js +++ b/awx/ui/client/features/output/index.controller.js @@ -810,7 +810,6 @@ function OutputIndexController ( onStop () { lockFollow = true; stopFollowing(); - stopListening(); status.updateStats(); status.dispatch(); status.sync(); diff --git a/awx/ui/client/features/output/status.service.js b/awx/ui/client/features/output/status.service.js index 8b3e995efd..356b9cbe1c 100644 --- a/awx/ui/client/features/output/status.service.js +++ b/awx/ui/client/features/output/status.service.js @@ -95,6 +95,9 @@ function JobStatusService (moment, message) { if (isJobStatusEvent) { this.setJobStatus(data.status); + if (JOB_STATUS_FINISHED.includes(data.status)) { + this.sync(); + } this.dispatch(); } else if (isProjectStatusEvent) { this.setProjectStatus(data.status);