Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions wasm/hf_xet_thin_wasm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,14 @@ impl ReconstructionTermManager {
let file_hash = self.file_hash;

let jh = tokio::task::spawn(async move {
// Check if a previously completed block has already discovered the file end,
// making this request unnecessary. This avoids sending a request that would
// return a 416 Range Not Satisfiable.
if prefetch_block_range.start >= known_final_byte_position.load(Ordering::Relaxed) {
known_final_byte_position.fetch_min(prefetch_block_range.start, Ordering::Relaxed);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line is a no-op -- this only triggers if prefetch_block_range.start is already >= known_final_byte_position, which means known_final_byte_position is already at the min of the two.

return Ok(None);
}

let result = retrieve_file_term_block(client, file_hash, prefetch_block_range).await;

// See if we're done with the file.
Expand Down
Loading