Fix Task unit calculation in Task::batch
This commit is contained in:
parent
bc66866bb8
commit
a6bcf69ea0
1 changed files with 9 additions and 4 deletions
|
|
@ -89,11 +89,16 @@ impl<T> Task<T> {
|
||||||
where
|
where
|
||||||
T: 'static,
|
T: 'static,
|
||||||
{
|
{
|
||||||
let select_all = stream::select_all(
|
let mut select_all = stream::SelectAll::new();
|
||||||
tasks.into_iter().filter_map(|task| task.stream),
|
let mut units = 0;
|
||||||
);
|
|
||||||
|
|
||||||
let units = select_all.len();
|
for task in tasks.into_iter() {
|
||||||
|
if let Some(stream) = task.stream {
|
||||||
|
select_all.push(stream);
|
||||||
|
}
|
||||||
|
|
||||||
|
units += task.units;
|
||||||
|
}
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
stream: Some(boxed_stream(select_all)),
|
stream: Some(boxed_stream(select_all)),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue