mirror of
https://github.com/ansible/awx.git
synced 2026-03-09 21:49:27 -02:30
Merge pull request #1263 from mabashian/1067-workflow-running-status
Handle workflow job status race condition
This commit is contained in:
@@ -195,6 +195,16 @@ export default ['workflowData', 'workflowResultsService', 'workflowDataOptions',
|
|||||||
if(data.hasOwnProperty('workflow_job_id') &&
|
if(data.hasOwnProperty('workflow_job_id') &&
|
||||||
parseInt(data.workflow_job_id, 10) === parseInt($scope.workflow.id,10)){
|
parseInt(data.workflow_job_id, 10) === parseInt($scope.workflow.id,10)){
|
||||||
|
|
||||||
|
// This check ensures that the workflow status icon doesn't get stuck in
|
||||||
|
// the waiting state due to the UI missing the initial socket message. This
|
||||||
|
// can happen if the GET request on the workflow job returns "waiting" and
|
||||||
|
// the sockets aren't established yet so we miss the event that indicates
|
||||||
|
// the workflow job has moved into a running state.
|
||||||
|
if (!_.includes(['running', 'successful', 'failed', 'error'], $scope.workflow.status)){
|
||||||
|
$scope.workflow.status = 'running';
|
||||||
|
runTimeElapsedTimer = workflowResultsService.createOneSecondTimer(moment(), updateWorkflowJobElapsedTimer);
|
||||||
|
}
|
||||||
|
|
||||||
WorkflowService.updateStatusOfNode({
|
WorkflowService.updateStatusOfNode({
|
||||||
treeData: $scope.treeData,
|
treeData: $scope.treeData,
|
||||||
nodeId: data.workflow_node_id,
|
nodeId: data.workflow_node_id,
|
||||||
|
|||||||
Reference in New Issue
Block a user