Skip to content

feat: introduce batched requests for async-loops #78

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

Merged
merged 2 commits into from
Sep 30, 2022
Merged

Conversation

shouyang
Copy link
Contributor

@shouyang shouyang commented Sep 2, 2022

@mheap

Hey there, I've been using the plugin to automate translating UI resource files and committing back the translated versions. I'm committing back ~30-50 small files and I've found the need to batch the section on createBlob. For completeness, I've also done the same with the other await-loop surrounding fileExistsInRepo for deleting files.

What's been done:

  • Introduced a new parameter batchSize, defaulting to n = 1.
  • Given a batchSize, split the change parameters into n concurrent requests, and map-and-await them using the existing implementation via Promise.all.
  • Test for parameter validation.
  • Readme section for use.

@mheap
Copy link
Owner

mheap commented Sep 30, 2022

This is awesome, thanks @shouyang!

@mheap mheap merged commit 9bfcb4b into mheap:main Sep 30, 2022
@mheap
Copy link
Owner

mheap commented Sep 30, 2022

Released as v4.2.0

@shouyang
Copy link
Contributor Author

Hey @mheap, could you update the npm releases, I see the latest as 4.1.0?
https://www.npmjs.com/package/octokit-commit-multiple-files

@mheap
Copy link
Owner

mheap commented Nov 11, 2022

@shouyang It looks as though the release job failed, then I missed this notification 🤦

4.2.0 is now released. Thank you for your patience

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