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: replace setImmediate with setTimeout #113

Merged
merged 1 commit into from
Aug 31, 2022

Conversation

sidwebworks
Copy link
Contributor

@sidwebworks sidwebworks commented Aug 31, 2022

Currently, the batchInsert function uses setImmediate to schedule the recursive insert calls to avoid blocking the event loop.

However, this causes the API to break in the browser where setImmediate is not defined as it's a Node API.

This PR fixes that issue by using setTimeout with a delay of 0.

cc// @micheleriva

Copy link
Member

@micheleriva micheleriva left a comment

Choose a reason for hiding this comment

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

Thanks! Lgtm

@micheleriva micheleriva merged commit 9416d61 into oramasearch:main Aug 31, 2022
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.

2 participants