mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 10:31:03 +00:00
Use SpawnNamed to give tasks names (#1379)
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
#![warn(missing_docs)]
|
||||
|
||||
use futures::prelude::*;
|
||||
use futures::{channel::{mpsc, oneshot}, task::Spawn};
|
||||
use futures::channel::{mpsc, oneshot};
|
||||
use keystore::KeyStorePtr;
|
||||
use polkadot_primitives::{
|
||||
Hash, Block,
|
||||
@@ -39,6 +39,7 @@ use client::{
|
||||
};
|
||||
use sp_api::{ApiExt, ProvideRuntimeApi};
|
||||
use codec::{Encode, Decode};
|
||||
use sp_core::traits::SpawnNamed;
|
||||
|
||||
use log::warn;
|
||||
|
||||
@@ -174,7 +175,7 @@ impl Store {
|
||||
&self,
|
||||
wrapped_block_import: I,
|
||||
client: Arc<P>,
|
||||
spawner: impl Spawn,
|
||||
spawner: impl SpawnNamed,
|
||||
keystore: KeyStorePtr,
|
||||
) -> ClientResult<AvailabilityBlockImport<I, P>>
|
||||
where
|
||||
|
||||
@@ -20,7 +20,7 @@ use std::sync::Arc;
|
||||
use std::thread;
|
||||
|
||||
use log::{error, info, trace, warn};
|
||||
use sp_blockchain::{Result as ClientResult};
|
||||
use sp_blockchain::Result as ClientResult;
|
||||
use sp_runtime::traits::{Header as HeaderT, Block as BlockT, HashFor, BlakeTwo256};
|
||||
use sp_api::{ApiExt, ProvideRuntimeApi};
|
||||
use client::{
|
||||
@@ -32,12 +32,13 @@ use consensus_common::{
|
||||
ImportResult,
|
||||
import_queue::CacheKeyId,
|
||||
};
|
||||
use sp_core::traits::SpawnNamed;
|
||||
use polkadot_primitives::{Block, BlockId, Hash};
|
||||
use polkadot_primitives::parachain::{
|
||||
ParachainHost, ValidatorId, AbridgedCandidateReceipt, AvailableData,
|
||||
ValidatorPair, ErasureChunk,
|
||||
};
|
||||
use futures::{prelude::*, future::select, channel::{mpsc, oneshot}, task::{Spawn, SpawnExt}};
|
||||
use futures::{prelude::*, future::select, channel::{mpsc, oneshot}};
|
||||
use futures::future::AbortHandle;
|
||||
use keystore::KeyStorePtr;
|
||||
|
||||
@@ -641,7 +642,7 @@ impl<I, P> AvailabilityBlockImport<I, P> {
|
||||
pub(crate) fn new(
|
||||
client: Arc<P>,
|
||||
block_import: I,
|
||||
spawner: impl Spawn,
|
||||
spawner: impl SpawnNamed,
|
||||
keystore: KeyStorePtr,
|
||||
to_worker: mpsc::UnboundedSender<WorkerMsg>,
|
||||
) -> Self
|
||||
@@ -662,9 +663,7 @@ impl<I, P> AvailabilityBlockImport<I, P> {
|
||||
to_worker.clone(),
|
||||
));
|
||||
|
||||
if let Err(_) = spawner.spawn(prune_available.map(drop)) {
|
||||
error!(target: LOG_TARGET, "Failed to spawn availability pruning task");
|
||||
}
|
||||
spawner.spawn("polkadot-prune-availibility", prune_available.map(drop).boxed());
|
||||
|
||||
AvailabilityBlockImport {
|
||||
client,
|
||||
|
||||
Reference in New Issue
Block a user