mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Ingest Manager] Fix polling for new agent action (#77339)
This commit is contained in:
parent
65b5f94a47
commit
0fb48950f5
1 changed files with 6 additions and 2 deletions
|
@ -53,11 +53,15 @@ function getInternalUserSOClient() {
|
|||
}
|
||||
|
||||
function createNewActionsSharedObservable(): Observable<AgentAction[]> {
|
||||
const internalSOClient = getInternalUserSOClient();
|
||||
let lastTimestamp = new Date().toISOString();
|
||||
|
||||
return timer(0, AGENT_UPDATE_ACTIONS_INTERVAL_MS).pipe(
|
||||
switchMap(() => {
|
||||
return from(getNewActionsSince(internalSOClient, new Date().toISOString()));
|
||||
const internalSOClient = getInternalUserSOClient();
|
||||
|
||||
const timestamp = lastTimestamp;
|
||||
lastTimestamp = new Date().toISOString();
|
||||
return from(getNewActionsSince(internalSOClient, timestamp));
|
||||
}),
|
||||
shareReplay({ refCount: true, bufferSize: 1 })
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue