use old state to restart the child (#289)

Signed-off-by: பாலாஜி <rbalajis25@gmail.com>
This commit is contained in:
Captain Meow 2020-12-03 12:24:38 +05:30 committed by GitHub
parent 44f433fcfa
commit a478cc66d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -616,14 +616,12 @@ impl Children {
let children = self.as_ref();
let supervisor = self.bcast.parent().clone().into_supervisor();
let state = Arc::new(Box::pin(ContextState::new()));
let ctx = BastionContext::new(
id.clone(),
child_ref.clone(),
children,
supervisor,
state.clone(),
old_state.clone(),
);
let exec = (self.init.0)(ctx);
@ -643,6 +641,7 @@ impl Children {
debug!("Children({}): Restarting Child({}).", self.id(), bcast.id());
let callbacks = self.callbacks.clone();
let state = Arc::new(Box::pin(ContextState::new()));
let child = Child::new(exec, callbacks, bcast, state, child_ref);
debug!(
"Children({}): Launching faulted Child({}).",