mirror of
https://github.com/ansible/awx.git
synced 2026-03-27 13:55:04 -02:30
Merge pull request #2826 from jakemcdermott/fix-2818
fix handling for potentially missed events on initialization
This commit is contained in:
@@ -363,9 +363,9 @@ function startListening () {
|
|||||||
|
|
||||||
function handleJobEvent (data) {
|
function handleJobEvent (data) {
|
||||||
streaming = streaming || resource.events
|
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 => {
|
.then(results => {
|
||||||
results = results.concat(data);
|
results.push(data);
|
||||||
|
|
||||||
const counters = results.map(({ counter }) => counter);
|
const counters = results.map(({ counter }) => counter);
|
||||||
const min = Math.min(...counters);
|
const min = Math.min(...counters);
|
||||||
@@ -383,7 +383,7 @@ function handleJobEvent (data) {
|
|||||||
results = results.filter(({ counter }) => counter > maxMissing);
|
results = results.filter(({ counter }) => counter > maxMissing);
|
||||||
}
|
}
|
||||||
|
|
||||||
stream.setMissingCounterThreshold(max + 1);
|
stream.setMissingCounterThreshold(max);
|
||||||
results.forEach(item => {
|
results.forEach(item => {
|
||||||
stream.pushJobEvent(item);
|
stream.pushJobEvent(item);
|
||||||
status.pushJobEvent(item);
|
status.pushJobEvent(item);
|
||||||
|
|||||||
Reference in New Issue
Block a user