Cope with teardown of supervisor
This commit is contained in:
parent
0922c6e9b1
commit
31e34039dc
|
@ -54,7 +54,8 @@ export class Supervisor {
|
||||||
Turn.activeFacet.onStop(() => {
|
Turn.activeFacet.onStop(() => {
|
||||||
const exitReason = this.supervisee?.exitReason;
|
const exitReason = this.supervisee?.exitReason;
|
||||||
if (!exitReason) {
|
if (!exitReason) {
|
||||||
throw new Error("Expected supervisee to have terminated");
|
// Supervisor shutdown. Supervisee will exit soon.
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (exitReason.ok && (this.config.restartPolicy === SupervisorRestartPolicy.ON_ERROR_ONLY)) {
|
if (exitReason.ok && (this.config.restartPolicy === SupervisorRestartPolicy.ON_ERROR_ONLY)) {
|
||||||
this.state.value = 'complete';
|
this.state.value = 'complete';
|
||||||
|
|
Loading…
Reference in New Issue