Generate and read channel config for test case

This commit is contained in:
Dominik Werder
2021-04-19 18:59:07 +02:00
parent 8c328cf6cf
commit d8ab42ccb9
8 changed files with 152 additions and 72 deletions

View File

@@ -7,7 +7,7 @@ use tracing::{debug, error, info, trace, warn};
pub fn run<T, F: std::future::Future<Output = Result<T, Error>>>(f: F) -> Result<T, Error> {
tracing_init();
tokio::runtime::Builder::new_multi_thread()
let res = tokio::runtime::Builder::new_multi_thread()
.worker_threads(12)
.max_blocking_threads(256)
.enable_all()
@@ -25,7 +25,14 @@ pub fn run<T, F: std::future::Future<Output = Result<T, Error>>>(f: F) -> Result
})
.build()
.unwrap()
.block_on(async { f.await })
.block_on(async { f.await });
match res {
Ok(k) => Ok(k),
Err(e) => {
error!("{:?}", e);
Err(e)
}
}
}
pub fn tracing_init() {