Return an error from project index tool when embedding query fails (#11264)
Previously, a failure to embed the search query (due to a rate limit error) would appear the same as if there were no results. * Avoid repeatedly embedding the search query for each worktree * Unify tasks for searching all worktree Release Notes: - N/A
This commit is contained in:
parent
4b767697af
commit
5831d80f51
4 changed files with 137 additions and 132 deletions
|
@ -98,12 +98,9 @@ fn chunk_lines(text: &str) -> Vec<Chunk> {
|
|||
|
||||
chunk_ranges
|
||||
.into_iter()
|
||||
.map(|range| {
|
||||
let mut hasher = Sha256::new();
|
||||
hasher.update(&text[range.clone()]);
|
||||
let mut digest = [0u8; 32];
|
||||
digest.copy_from_slice(hasher.finalize().as_slice());
|
||||
Chunk { range, digest }
|
||||
.map(|range| Chunk {
|
||||
digest: Sha256::digest(&text[range.clone()]).into(),
|
||||
range,
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue