[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
|
@ -249,5 +249,11 @@ export class DevServer {
|
||||||
)
|
)
|
||||||
.subscribe(subscriber)
|
.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",
|
"ready: false",
|
||||||
"<issue>",
|
"<issue>",
|
||||||
"ready: true",
|
"ready: true",
|
||||||
|
"complete",
|
||||||
]
|
]
|
||||||
`);
|
`);
|
||||||
|
|
||||||
|
|
|
@ -107,14 +107,26 @@ export class Optimizer {
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
this.run$ = runOptimizer(config).pipe(
|
this.run$ = new Rx.Observable<void>((subscriber) => {
|
||||||
logOptimizerState(log, config),
|
subscriber.add(
|
||||||
tap(({ state }) => {
|
runOptimizer(config)
|
||||||
this.phase$.next(state.phase);
|
.pipe(
|
||||||
this.ready$.next(state.phase === 'success' || state.phase === 'issue');
|
logOptimizerState(log, config),
|
||||||
}),
|
tap(({ state }) => {
|
||||||
ignoreElements()
|
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$() {
|
getPhase$() {
|
||||||
|
|
|
@ -103,6 +103,11 @@ export class Watcher {
|
||||||
.pipe(ignoreElements())
|
.pipe(ignoreElements())
|
||||||
.subscribe(subscriber)
|
.subscribe(subscriber)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// complete state subjects when run$ completes
|
||||||
|
subscriber.add(() => {
|
||||||
|
this.restart$.complete();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
serverShouldRestart$() {
|
serverShouldRestart$() {
|
||||||
|
|
Loading…
Reference in a new issue