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: limit bulk API requests to batches of 5,000 #554

Merged

Conversation

petebacondarwin
Copy link
Contributor

@petebacondarwin petebacondarwin commented Mar 7, 2022

The kv:bulk delete and kv:bulk put commands now batch up requests in groups of 5,000,
displaying progress for each request.

@changeset-bot
Copy link

changeset-bot bot commented Mar 7, 2022

🦋 Changeset detected

Latest commit: 486e917

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
wrangler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Mar 7, 2022

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/1948186101/npm-package-wrangler-554

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/554/npm-package-wrangler-554

Or you can use npx with this latest build directly:

npx https://prerelease-registry.developers.workers.dev/runs/1948186101/npm-package-wrangler-554 dev path/to/script.js

@petebacondarwin petebacondarwin changed the title fix: limit bulk delete API requests to batches of 5,000 fix: limit bulk API requests to batches of 5,000 Mar 7, 2022
The `kv:bulk delete` command now batches up delete requests in groups of 5,000,
displaying progress for each request.
The `kv:bulk put` command now batches up put requests in groups of 5,000,
displaying progress for each request.
Copy link
Contributor

@threepointone threepointone left a comment

Choose a reason for hiding this comment

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

image

);
expect(requests.count).toEqual(3);
expect(std.out).toMatchInlineSnapshot(`
"Uploaded 0 of 12000.
Copy link
Contributor

@Electroid Electroid Mar 8, 2022

Choose a reason for hiding this comment

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

I think we should land this, but a potential followup could be a percentage?
Something like: Uploaded 7% (1.5k out of 100.3k)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added an issue to track this #555

@petebacondarwin petebacondarwin merged commit 18ac439 into cloudflare:main Mar 8, 2022
@github-actions github-actions bot mentioned this pull request Mar 8, 2022
@petebacondarwin petebacondarwin deleted the bulk-delete-batches branch March 8, 2022 08:51
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