mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 20:17:57 +00:00
Change SpawnedSubsystem type to log subsystem errors (#1878)
* Change SpawnedSubsystem type to log subsystem errors * Remove clone
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
#![deny(missing_docs, unused_crate_dependencies)]
|
||||
|
||||
use std::time::Duration;
|
||||
use futures::{channel::oneshot, FutureExt};
|
||||
use futures::{channel::oneshot, FutureExt, TryFutureExt};
|
||||
use log::trace;
|
||||
use thiserror::Error;
|
||||
|
||||
@@ -122,9 +122,14 @@ where
|
||||
Context: SubsystemContext<Message = CollatorProtocolMessage> + Sync + Send,
|
||||
{
|
||||
fn start(self, ctx: Context) -> SpawnedSubsystem {
|
||||
let future = self
|
||||
.run(ctx)
|
||||
.map_err(|e| SubsystemError::with_origin("collator-protocol", e))
|
||||
.boxed();
|
||||
|
||||
SpawnedSubsystem {
|
||||
name: "collator-protocol-subsystem",
|
||||
future: self.run(ctx).map(|_| ()).boxed(),
|
||||
future,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user