Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure that minThreads is respected when using isolateWorkers #60

Merged
merged 1 commit into from
Jun 17, 2023

Conversation

danez
Copy link
Contributor

@danez danez commented Jun 16, 2023

I noticed that when using isolateWorkers: true, minThreads is not respected correctly.

After every worker run the worker is terminated, but no new workers are started unless the task-queue is bigger than the worker count.

This fix ensures that after a worker is terminated we ensure that we have the minimum amount of workers running.

Let me know what you think about this. :)

test/simple.test.ts Outdated Show resolved Hide resolved
@danez danez requested a review from AriPerkkio June 16, 2023 11:31
Copy link
Member

@AriPerkkio AriPerkkio left a comment

Choose a reason for hiding this comment

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

Verified by testing manually and tested against Vitest's internal tests and other local projects using Vitest. Looks good.

@Aslemammad
Copy link
Member

@danez @AriPerkkio Thank you so much, guys.

@Aslemammad Aslemammad merged commit 977df66 into tinylibs:main Jun 17, 2023
@danez danez deleted the minThreads branch June 17, 2023 18:01
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