Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
bluegenes committed Dec 10, 2024
1 parent ae1bf4e commit bfd3c37
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/directsketch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,6 @@ async fn dl_sketch_url(
}
}

// Ok((built_sigs, download_failures, checksum_failures))
Ok((sigs, download_failures, checksum_failures))
}

Expand Down Expand Up @@ -613,7 +612,6 @@ pub fn zipwriter_handle(
let mut zip_manifest = BuildManifest::new();
let mut wrote_sigs = false;
let mut acc_count = 0; // count the number of accessions (or urls, in urlsketch)
// let mut file_count = 0; // Count of files in the current batch
let mut zip_writer = None;

if let Some(outpath) = output_sigs {
Expand All @@ -639,7 +637,6 @@ pub fn zipwriter_handle(
.await
{
Ok(_) => {
// file_count += sigcoll.size();
wrote_sigs = true;
}
Err(e) => {
Expand All @@ -651,14 +648,12 @@ pub fn zipwriter_handle(
}
// Add all records from buildcoll manifest
zip_manifest.extend_from_manifest(&buildcoll.manifest);
// }
// each buildcoll has accession
acc_count += 1;
}

// if batch size is non-zero and is reached, close the current zip
if batch_size > 0 && acc_count >= batch_size {
// if batch_size > 0 && file_count >= batch_size {
eprintln!("writing batch {}", batch_index);
if let Some(mut zip_writer) = zip_writer.take() {
if let Err(e) = zip_manifest
Expand All @@ -675,14 +670,12 @@ pub fn zipwriter_handle(
}
// Start a new batch
batch_index += 1;
// file_count = 0;
acc_count = 0;
zip_manifest.clear();
zip_writer = None; // reset zip_writer so a new zip will be created when needed
}
}

// if file_count > 0 {
if acc_count > 0 {
// write the final manifest
if let Some(mut zip_writer) = zip_writer.take() {
Expand Down Expand Up @@ -1144,7 +1137,6 @@ pub async fn urlsketch(
}

// create channels. buffer size here is 4 b/c we can do 3 downloads simultaneously
// let (send_sigs, recv_sigs) = tokio::sync::mpsc::channel::<MultiBuildCollection>(4);
let (send_sigs, recv_sigs) = tokio::sync::mpsc::channel::<BuildCollection>(4);
let (send_failed, recv_failed) = tokio::sync::mpsc::channel::<FailedDownload>(4);
let (send_failed_checksums, recv_failed_checksum) =
Expand Down

0 comments on commit bfd3c37

Please sign in to comment.