|
@@ -4,6 +4,7 @@ use std::sync::Arc;
|
|
|
use async_executor::Executor;
|
|
use async_executor::Executor;
|
|
|
use clap::clap_app;
|
|
use clap::clap_app;
|
|
|
use easy_parallel::Parallel;
|
|
use easy_parallel::Parallel;
|
|
|
|
|
+use log::debug;
|
|
|
|
|
|
|
|
use drk::{
|
|
use drk::{
|
|
|
blockchain::{rocks::columns, Rocks, RocksColumn},
|
|
blockchain::{rocks::columns, Rocks, RocksColumn},
|
|
@@ -57,9 +58,13 @@ async fn main() -> Result<()> {
|
|
|
|
|
|
|
|
let ex2 = ex.clone();
|
|
let ex2 = ex.clone();
|
|
|
|
|
|
|
|
|
|
+ let nthreads = num_cpus::get();
|
|
|
|
|
+ debug!(target: "GATEWAY DAEMON", "Run {} executor threads", nthreads);
|
|
|
|
|
+
|
|
|
let (_, result) = Parallel::new()
|
|
let (_, result) = Parallel::new()
|
|
|
- // Run four executor threads.
|
|
|
|
|
- .each(0..3, |_| smol::future::block_on(ex.run(shutdown.recv())))
|
|
|
|
|
|
|
+ .each(0..nthreads, |_| {
|
|
|
|
|
+ smol::future::block_on(ex.run(shutdown.recv()))
|
|
|
|
|
+ })
|
|
|
// Run the main future on the current thread.
|
|
// Run the main future on the current thread.
|
|
|
.finish(|| {
|
|
.finish(|| {
|
|
|
smol::future::block_on(async move {
|
|
smol::future::block_on(async move {
|