Change SpawnedSubsystem type to log subsystem errors (#1878)

* Change SpawnedSubsystem type to log subsystem errors

* Remove clone
This commit is contained in:
Fedor Sakharov
2020-10-28 22:57:06 +03:00
committed by GitHub
parent 8a305ac963
commit 935fcd1666
16 changed files with 42 additions and 27 deletions
+3 -3
View File
@@ -164,7 +164,7 @@ pub struct SpawnedSubsystem {
/// Name of the subsystem being spawned.
pub name: &'static str,
/// The task of the subsystem being spawned.
pub future: BoxFuture<'static, ()>,
pub future: BoxFuture<'static, SubsystemResult<()>>,
}
/// A `Result` type that wraps [`SubsystemError`].
@@ -233,8 +233,8 @@ impl<C: SubsystemContext> Subsystem<C> for DummySubsystem {
let future = Box::pin(async move {
loop {
match ctx.recv().await {
Ok(FromOverseer::Signal(OverseerSignal::Conclude)) => return,
Err(_) => return,
Ok(FromOverseer::Signal(OverseerSignal::Conclude)) => return Ok(()),
Err(_) => return Ok(()),
_ => continue,
}
}