mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 13:31:10 +00:00
Move spawning tasks from thread pools to Service's TaskManager for block importing (#5647)
Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>
This commit is contained in:
@@ -606,11 +606,15 @@ pub trait TestNetFactory: Sized {
|
||||
);
|
||||
let verifier = VerifierAdapter::new(Arc::new(Mutex::new(Box::new(verifier) as Box<_>)));
|
||||
|
||||
let threads_pool = futures::executor::ThreadPool::new().unwrap();
|
||||
let spawner = |future| threads_pool.spawn_ok(future);
|
||||
|
||||
let import_queue = Box::new(BasicQueue::new(
|
||||
verifier.clone(),
|
||||
Box::new(block_import.clone()),
|
||||
justification_import,
|
||||
finality_proof_import,
|
||||
spawner,
|
||||
));
|
||||
|
||||
let listen_addr = build_multiaddr![Memory(rand::random::<u64>())];
|
||||
@@ -683,11 +687,15 @@ pub trait TestNetFactory: Sized {
|
||||
);
|
||||
let verifier = VerifierAdapter::new(Arc::new(Mutex::new(Box::new(verifier) as Box<_>)));
|
||||
|
||||
let threads_pool = futures::executor::ThreadPool::new().unwrap();
|
||||
let spawner = |future| threads_pool.spawn_ok(future);
|
||||
|
||||
let import_queue = Box::new(BasicQueue::new(
|
||||
verifier.clone(),
|
||||
Box::new(block_import.clone()),
|
||||
justification_import,
|
||||
finality_proof_import,
|
||||
spawner,
|
||||
));
|
||||
|
||||
let listen_addr = build_multiaddr![Memory(rand::random::<u64>())];
|
||||
|
||||
Reference in New Issue
Block a user