diff --git a/htsget-http-core/src/http_core.rs b/htsget-http-core/src/http_core.rs index e50e1468a..9838624b0 100644 --- a/htsget-http-core/src/http_core.rs +++ b/htsget-http-core/src/http_core.rs @@ -48,7 +48,7 @@ pub async fn get_response_for_post_request( let mut futures = FuturesOrdered::new(); for query in request.get_queries(id)? { let owned_searcher = searcher.clone(); - futures.push(tokio::spawn( + futures.push_back(tokio::spawn( async move { owned_searcher.search(query).await }, )); } diff --git a/htsget-search/src/htsget/bcf_search.rs b/htsget-search/src/htsget/bcf_search.rs index 00a776c22..6a1eec411 100644 --- a/htsget-search/src/htsget/bcf_search.rs +++ b/htsget-search/src/htsget/bcf_search.rs @@ -86,7 +86,7 @@ where for (ref_seq_index, (name, _)) in header.contigs().iter().enumerate() { let owned_name = name.to_owned(); let owned_reference_name = reference_name.clone(); - futures.push(tokio::spawn(async move { + futures.push_back(tokio::spawn(async move { if owned_name == owned_reference_name { Some((ref_seq_index, owned_name)) } else { diff --git a/htsget-search/src/htsget/cram_search.rs b/htsget-search/src/htsget/cram_search.rs index 2cc51d5f1..62959a17f 100644 --- a/htsget-search/src/htsget/cram_search.rs +++ b/htsget-search/src/htsget/cram_search.rs @@ -204,7 +204,7 @@ where let owned_next = next.clone(); let owned_predicate = predicate.clone(); let range = interval.clone(); - futures.push(tokio::spawn(async move { + futures.push_back(tokio::spawn(async move { if owned_predicate(&owned_record) { Self::bytes_ranges_for_record(range, &owned_record, owned_next.offset()) } else { diff --git a/htsget-search/src/htsget/search.rs b/htsget-search/src/htsget/search.rs index cac2c0ccd..6b8c9be10 100644 --- a/htsget-search/src/htsget/search.rs +++ b/htsget-search/src/htsget/search.rs @@ -296,14 +296,14 @@ where DataBlock::Range(range) => { let storage = self.get_storage(); let id = id.clone(); - storage_futures.push(tokio::spawn(async move { + storage_futures.push_back(tokio::spawn(async move { storage .range_url(format.fmt_file(&id), RangeUrlOptions::from(range)) .await })); } DataBlock::Data(data, class) => { - storage_futures.push(tokio::spawn(async move { Ok(S::data_url(data, class)) })); + storage_futures.push_back(tokio::spawn(async move { Ok(S::data_url(data, class)) })); } } } diff --git a/htsget-search/src/htsget/vcf_search.rs b/htsget-search/src/htsget/vcf_search.rs index 1140eefc1..e2bc8b547 100644 --- a/htsget-search/src/htsget/vcf_search.rs +++ b/htsget-search/src/htsget/vcf_search.rs @@ -87,7 +87,7 @@ where for (index, name) in index.header().reference_sequence_names().iter().enumerate() { let owned_name = name.to_owned(); let owned_reference_name = reference_name.clone(); - futures.push(tokio::spawn(async move { + futures.push_back(tokio::spawn(async move { if owned_name == owned_reference_name { Some(index) } else {