From 5e974d84b653c5557a54e159062106f660c30e50 Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Sat, 11 Aug 2018 13:14:22 -0400 Subject: [PATCH] fix handling for missed events on initialization --- awx/ui/client/features/output/index.controller.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/awx/ui/client/features/output/index.controller.js b/awx/ui/client/features/output/index.controller.js index 88d86ca91b..bae2c9596c 100644 --- a/awx/ui/client/features/output/index.controller.js +++ b/awx/ui/client/features/output/index.controller.js @@ -359,9 +359,9 @@ function startListening () { function handleJobEvent (data) { streaming = streaming || resource.events - .getRange([Math.max(1, data.counter - 50), data.counter + 50]) + .getRange([Math.max(0, data.counter - 50), data.counter + 50]) .then(results => { - results = results.concat(data); + results.push(data); const counters = results.map(({ counter }) => counter); const min = Math.min(...counters); @@ -379,7 +379,7 @@ function handleJobEvent (data) { results = results.filter(({ counter }) => counter > maxMissing); } - stream.setMissingCounterThreshold(max + 1); + stream.setMissingCounterThreshold(max); results.forEach(item => { stream.pushJobEvent(item); status.pushJobEvent(item);