Replace easy-parallel with scoped-pool for path searches
The easy-parallel crate spawned new threads on each call, which was resulting in way too many threads. Co-Authored-By: Brooks Swinnerton <934497+bswinnerton@users.noreply.github.com>
This commit is contained in:
co-authored by
Brooks Swinnerton
parent
f455355c78
commit
4cef25eff8
@@ -347,8 +347,9 @@ impl FileFinder {
|
||||
fn spawn_search(&mut self, query: String, ctx: &mut ViewContext<Self>) {
|
||||
let worktrees = self.worktrees(ctx.as_ref());
|
||||
let search_id = util::post_inc(&mut self.search_count);
|
||||
let pool = ctx.app().scoped_pool().clone();
|
||||
let task = ctx.background_executor().spawn(async move {
|
||||
let matches = match_paths(worktrees.as_slice(), &query, false, false, 100);
|
||||
let matches = match_paths(worktrees.as_slice(), &query, false, false, 100, pool);
|
||||
(search_id, matches)
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user