mirror of
https://github.com/ansible/awx.git
synced 2026-01-23 23:41:23 -03:30
fix handling for missed events on initialization
This commit is contained in:
parent
49222d5e72
commit
5e974d84b6
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user