Skip to content

fix(angular-toolkit-mcp-server): fix scanning performance issue on win#24

Merged
Karnaukhov-kh merged 1 commit intomainfrom
feature/fix-scan-perf
Mar 10, 2026
Merged

fix(angular-toolkit-mcp-server): fix scanning performance issue on win#24
Karnaukhov-kh merged 1 commit intomainfrom
feature/fix-scan-perf

Conversation

@Karnaukhov-kh
Copy link
Member

This pull request introduces a concurrency control mechanism to the file search utility in find-in-file.ts. The main goal is to prevent EMFILE errors (too many open files) on Windows by limiting the number of simultaneous file operations. The changes refactor the search logic to use a worker pool pattern, improving reliability and scalability when searching through many files.

Concurrency improvements:

  • Added a processWithConcurrency function that processes items with a configurable concurrency limit using a semaphore pattern, defaulting to 50 concurrent operations. This helps prevent EMFILE errors during file operations.
  • Refactored the main file search loop in findFilesWithPattern to use processWithConcurrency, enabling parallel processing of files while respecting the concurrency limit. Results are flattened after processing.

@Karnaukhov-kh Karnaukhov-kh merged commit 626e270 into main Mar 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants