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

Remove awaits in loops #37

Open
makew0rld opened this issue Jul 19, 2023 · 1 comment
Open

Remove awaits in loops #37

makew0rld opened this issue Jul 19, 2023 · 1 comment

Comments

@makew0rld
Copy link
Contributor

Currently there are many lines in the code violating no-await-in-loop . They are ignored with // eslint-disable-next-line no-await-in-loop, but in the longer term they should be fixed for performance reasons. It will become more important the more sources are used.

makew0rld added a commit that referenced this issue Jul 24, 2023
@makew0rld
Copy link
Contributor Author

makew0rld commented Jul 24, 2023

This is fixed in the Uwazi in 199e6db, which was the main place it was needed.

There are still two loop awaits in the backend import script, but their performance impact is not critical at the moment, and would require a lot of testing to be confident in removing them. From my reading of the code they should be easy to remove, since the actual db work is protected by a "batch" (like a transaction). But as I recall, there were still some issues when I actually tried to remove them and do an import.

Edit: discussed in holepunchto/hyperbee#116

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

No branches or pull requests

1 participant