mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 19:21:03 +00:00
Change SpawnedSubsystem type to log subsystem errors (#1878)
* Change SpawnedSubsystem type to log subsystem errors * Remove clone
This commit is contained in:
@@ -27,7 +27,7 @@ use std::sync::Arc;
|
||||
use std::time::{Duration, SystemTime, SystemTimeError, UNIX_EPOCH};
|
||||
|
||||
use codec::{Encode, Decode};
|
||||
use futures::{select, channel::oneshot, future::{self, Either}, Future, FutureExt};
|
||||
use futures::{select, channel::oneshot, future::{self, Either}, Future, FutureExt, TryFutureExt};
|
||||
use futures_timer::Delay;
|
||||
use kvdb_rocksdb::{Database, DatabaseConfig};
|
||||
use kvdb::{KeyValueDB, DBTransaction};
|
||||
@@ -969,9 +969,7 @@ where
|
||||
{
|
||||
fn start(self, ctx: Context) -> SpawnedSubsystem {
|
||||
let future = run(self, ctx)
|
||||
.map(|r| if let Err(e) = r {
|
||||
log::error!(target: "availabilitystore", "Subsystem exited with an error {:?}", e);
|
||||
})
|
||||
.map_err(|e| SubsystemError::with_origin("availability-store", e))
|
||||
.boxed();
|
||||
|
||||
SpawnedSubsystem {
|
||||
|
||||
@@ -121,7 +121,6 @@ impl<S, C> Subsystem<C> for CandidateValidationSubsystem<S> where
|
||||
fn start(self, ctx: C) -> SpawnedSubsystem {
|
||||
let future = run(ctx, self.spawn, self.metrics)
|
||||
.map_err(|e| SubsystemError::with_origin("candidate-validation", e))
|
||||
.map(|_| ())
|
||||
.boxed();
|
||||
SpawnedSubsystem {
|
||||
name: "candidate-validation-subsystem",
|
||||
|
||||
@@ -67,7 +67,6 @@ impl<Client, Context> Subsystem<Context> for ChainApiSubsystem<Client> where
|
||||
fn start(self, ctx: Context) -> SpawnedSubsystem {
|
||||
let future = run(ctx, self)
|
||||
.map_err(|e| SubsystemError::with_origin("chain-api", e))
|
||||
.map(|_| ())
|
||||
.boxed();
|
||||
SpawnedSubsystem {
|
||||
future,
|
||||
|
||||
@@ -60,7 +60,7 @@ impl<Client, Context> Subsystem<Context> for RuntimeApiSubsystem<Client> where
|
||||
{
|
||||
fn start(self, ctx: Context) -> SpawnedSubsystem {
|
||||
SpawnedSubsystem {
|
||||
future: run(ctx, self).map(|_| ()).boxed(),
|
||||
future: run(ctx, self).boxed(),
|
||||
name: "runtime-api-subsystem",
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user