mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 01:13:23 -04:00
[cli-dev-mode] complete state subjects when shutting down (#96003)
Co-authored-by: spalger <spalger@users.noreply.github.com>
This commit is contained in:
parent
9c5641dbd7
commit
3187567a0e
4 changed files with 32 additions and 8 deletions
|
@ -249,5 +249,11 @@ export class DevServer {
|
|||
)
|
||||
.subscribe(subscriber)
|
||||
);
|
||||
|
||||
// complete state subjects when run$ completes
|
||||
subscriber.add(() => {
|
||||
this.phase$.complete();
|
||||
this.ready$.complete();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -180,6 +180,7 @@ it('is ready when optimizer phase is success or issue and logs in familiar forma
|
|||
"ready: false",
|
||||
"<issue>",
|
||||
"ready: true",
|
||||
"complete",
|
||||
]
|
||||
`);
|
||||
|
||||
|
|
|
@ -107,14 +107,26 @@ export class Optimizer {
|
|||
},
|
||||
]);
|
||||
|
||||
this.run$ = runOptimizer(config).pipe(
|
||||
logOptimizerState(log, config),
|
||||
tap(({ state }) => {
|
||||
this.phase$.next(state.phase);
|
||||
this.ready$.next(state.phase === 'success' || state.phase === 'issue');
|
||||
}),
|
||||
ignoreElements()
|
||||
);
|
||||
this.run$ = new Rx.Observable<void>((subscriber) => {
|
||||
subscriber.add(
|
||||
runOptimizer(config)
|
||||
.pipe(
|
||||
logOptimizerState(log, config),
|
||||
tap(({ state }) => {
|
||||
this.phase$.next(state.phase);
|
||||
this.ready$.next(state.phase === 'success' || state.phase === 'issue');
|
||||
}),
|
||||
ignoreElements()
|
||||
)
|
||||
.subscribe(subscriber)
|
||||
);
|
||||
|
||||
// complete state subjects when run$ completes
|
||||
subscriber.add(() => {
|
||||
this.phase$.complete();
|
||||
this.ready$.complete();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
getPhase$() {
|
||||
|
|
|
@ -103,6 +103,11 @@ export class Watcher {
|
|||
.pipe(ignoreElements())
|
||||
.subscribe(subscriber)
|
||||
);
|
||||
|
||||
// complete state subjects when run$ completes
|
||||
subscriber.add(() => {
|
||||
this.restart$.complete();
|
||||
});
|
||||
});
|
||||
|
||||
serverShouldRestart$() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue