From f109e8db7cfc6c7fa38a88b672250566c16199cd Mon Sep 17 00:00:00 2001 From: dagou Date: Mon, 19 Aug 2024 09:22:33 +0800 Subject: [PATCH] bug fix --- kr2r/src/bin/resolve.rs | 11 +++++++---- seqkmer/src/parallel.rs | 3 ++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/kr2r/src/bin/resolve.rs b/kr2r/src/bin/resolve.rs index 93d0330..8d773ad 100644 --- a/kr2r/src/bin/resolve.rs +++ b/kr2r/src/bin/resolve.rs @@ -167,14 +167,17 @@ fn process_batch>( ); Some(output_line) } else { + eprintln!("can't find {} in sample_id map file", k); None } }, |result| { - while let Some(Some(res)) = result.next() { - writer - .write_all(res.as_bytes()) - .expect("write output content error"); + while let Some(output) = result.next() { + if let Some(res) = output { + writer + .write_all(res.as_bytes()) + .expect("write output content error"); + } } }, ) diff --git a/seqkmer/src/parallel.rs b/seqkmer/src/parallel.rs index 290a8b2..762701b 100644 --- a/seqkmer/src/parallel.rs +++ b/seqkmer/src/parallel.rs @@ -7,6 +7,7 @@ use scoped_threadpool::Pool; use std::collections::HashMap; use std::io::Result; use std::sync::Arc; + pub struct ParallelResult

where P: Send, @@ -164,7 +165,7 @@ where let _ = func(&mut parallel_result); }); - // pool_scope.join_all(); + pool_scope.join_all(); }); Ok(())