-
Notifications
You must be signed in to change notification settings - Fork 60
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
Feature: Implementation of createMany lifecycle hook #972
Feature: Implementation of createMany lifecycle hook #972
Conversation
…ad of creating a single update task for every document
… introduced in @strapi/strapi: 4.9.0
@brunoocasali Looking forward to your review. |
@brunoocasali Any news on this? This would be an important change also for the company I am working at |
Hi folks! I just merged the support for strapi v5 #964, which made this PR outdated. Can you fix those conflicts? |
Hey Bruno, We can address these changes. Regardless, I think these changes should've been merged and released in a minor version of the plugin. Since some people might not be able to upgrade to Strapi v5 and (correct me) the newer plugin version will not be compatible with Strapi v4? |
You're right :/ Even if the plugin is compatible, users could have other plugins blocking their upgrade. So, if we want to provide the feature to both cases, we would need to provide two different releases. If you're willing to do it, we can do that! I would ask you to open another PR pointing to the HEAD before the last merge v0.12.0. Then, I can release it as v0.12.1. |
const ids = result.ids | ||
|
||
const entries = [] | ||
const BATCH_SIZE = 500 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you transform this into a customizable param that people could choose from in the plugin initializer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a hard limit given by strapis sql engine when compiling a query (or the database im not sure).
Co-authored-by: Bruno Casali <[email protected]>
bors merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🎉
Thanks a lot for your PR! If you want to release it for v4, you can create a PR like I mentioned earlier!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors merge
@Ra0R, sorry, can you rebase? Looks like we cannot merge with our tool (bug) and the branch is out dated, but I don't know why I cannot update it 😢 So, can you rebase (or pull |
Bumps the production group with 5 updates in the / directory: | Package | From | To | | --- | --- | --- | | @strapi/design-system | `2.0.0-rc.11` | `2.0.0-rc.14` | | @strapi/icons | `2.0.0-rc.11` | `2.0.0-rc.14` | | [meilisearch](https://github.com/meilisearch/meilisearch-js) | `0.42.0` | `0.45.0` | | [@strapi/sdk-plugin](https://github.com/strapi/sdk-plugin) | `5.2.6` | `5.2.7` | | [@strapi/strapi](https://github.com/strapi/strapi) | `5.0.1` | `5.4.1` | Updates `@strapi/design-system` from 2.0.0-rc.11 to 2.0.0-rc.14 Updates `@strapi/icons` from 2.0.0-rc.11 to 2.0.0-rc.14 Updates `meilisearch` from 0.42.0 to 0.45.0 - [Release notes](https://github.com/meilisearch/meilisearch-js/releases) - [Commits](meilisearch/meilisearch-js@v0.42.0...v0.45.0) Updates `@strapi/sdk-plugin` from 5.2.6 to 5.2.7 - [Release notes](https://github.com/strapi/sdk-plugin/releases) - [Changelog](https://github.com/strapi/sdk-plugin/blob/main/CHANGELOG.md) - [Commits](strapi/sdk-plugin@v5.2.6...v5.2.7) Updates `@strapi/strapi` from 5.0.1 to 5.4.1 - [Release notes](https://github.com/strapi/strapi/releases) - [Commits](strapi/strapi@v5.0.1...v5.4.1) --- updated-dependencies: - dependency-name: "@strapi/design-system" dependency-type: direct:production update-type: version-update:semver-patch dependency-group: production - dependency-name: "@strapi/icons" dependency-type: direct:production update-type: version-update:semver-patch dependency-group: production - dependency-name: meilisearch dependency-type: direct:production update-type: version-update:semver-minor dependency-group: production - dependency-name: "@strapi/sdk-plugin" dependency-type: direct:development update-type: version-update:semver-patch dependency-group: production - dependency-name: "@strapi/strapi" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: production ... Signed-off-by: dependabot[bot] <[email protected]>
@Ra0R this is weird, there are commits in your branch (related to strapi v5) that should not be here. thank you again for the PR |
@curquiza I merged main into the feature branch. |
@Ra0R can you rebase instead of pulling? I created a guide here to do it. Sorry for the inconvenience |
…ad of creating a single update task for every document
Co-authored-by: Bruno Casali <[email protected]>
Bumps the production group with 5 updates in the / directory: | Package | From | To | | --- | --- | --- | | @strapi/design-system | `2.0.0-rc.11` | `2.0.0-rc.14` | | @strapi/icons | `2.0.0-rc.11` | `2.0.0-rc.14` | | [meilisearch](https://github.com/meilisearch/meilisearch-js) | `0.42.0` | `0.45.0` | | [@strapi/sdk-plugin](https://github.com/strapi/sdk-plugin) | `5.2.6` | `5.2.7` | | [@strapi/strapi](https://github.com/strapi/strapi) | `5.0.1` | `5.4.1` | Updates `@strapi/design-system` from 2.0.0-rc.11 to 2.0.0-rc.14 Updates `@strapi/icons` from 2.0.0-rc.11 to 2.0.0-rc.14 Updates `meilisearch` from 0.42.0 to 0.45.0 - [Release notes](https://github.com/meilisearch/meilisearch-js/releases) - [Commits](meilisearch/meilisearch-js@v0.42.0...v0.45.0) Updates `@strapi/sdk-plugin` from 5.2.6 to 5.2.7 - [Release notes](https://github.com/strapi/sdk-plugin/releases) - [Changelog](https://github.com/strapi/sdk-plugin/blob/main/CHANGELOG.md) - [Commits](strapi/sdk-plugin@v5.2.6...v5.2.7) Updates `@strapi/strapi` from 5.0.1 to 5.4.1 - [Release notes](https://github.com/strapi/strapi/releases) - [Commits](strapi/strapi@v5.0.1...v5.4.1) --- updated-dependencies: - dependency-name: "@strapi/design-system" dependency-type: direct:production update-type: version-update:semver-patch dependency-group: production - dependency-name: "@strapi/icons" dependency-type: direct:production update-type: version-update:semver-patch dependency-group: production - dependency-name: meilisearch dependency-type: direct:production update-type: version-update:semver-minor dependency-group: production - dependency-name: "@strapi/sdk-plugin" dependency-type: direct:development update-type: version-update:semver-patch dependency-group: production - dependency-name: "@strapi/strapi" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: production ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps the playground group in /playground with 26 updates: | Package | From | To | | --- | --- | --- | | [@strapi/plugin-users-permissions](https://github.com/strapi/strapi) | `5.0.1` | `5.4.2` | | [@strapi/strapi](https://github.com/strapi/strapi) | `5.0.1` | `5.4.2` | | [meilisearch](https://github.com/meilisearch/meilisearch-js) | `0.36.0` | `0.45.0` | | [@strapi/admin](https://github.com/strapi/strapi) | `5.0.1` | `5.4.2` | | [@strapi/cloud-cli](https://github.com/strapi/strapi) | `5.0.1` | `5.4.2` | | [@strapi/content-manager](https://github.com/strapi/strapi) | `5.0.1` | `5.4.2` | | [@strapi/content-releases](https://github.com/strapi/strapi) | `5.0.1` | `5.4.2` | | [@strapi/content-type-builder](https://github.com/strapi/strapi) | `5.0.1` | `5.4.2` | | [@strapi/core](https://github.com/strapi/strapi) | `5.0.1` | `5.4.2` | | @strapi/data-transfer | `5.0.1` | `5.4.2` | | [@strapi/database](https://github.com/strapi/strapi) | `5.0.1` | `5.4.2` | | @strapi/design-system | `2.0.0-rc.11` | `2.0.0-rc.13` | | [@strapi/email](https://github.com/strapi/strapi) | `5.0.1` | `5.4.2` | | [@strapi/generators](https://github.com/strapi/strapi) | `5.0.1` | `5.4.2` | | [@strapi/i18n](https://github.com/strapi/strapi/tree/HEAD/packages/plugins/i18n) | `5.0.1` | `5.4.2` | | @strapi/icons | `2.0.0-rc.11` | `2.0.0-rc.13` | | [@strapi/logger](https://github.com/strapi/strapi) | `5.0.1` | `5.4.2` | | [@strapi/permissions](https://github.com/strapi/strapi) | `5.0.1` | `5.4.2` | | [@strapi/provider-email-sendmail](https://github.com/strapi/strapi) | `5.0.1` | `5.4.2` | | [@strapi/provider-upload-local](https://github.com/strapi/strapi) | `5.0.1` | `5.4.2` | | [@strapi/review-workflows](https://github.com/strapi/strapi) | `5.0.1` | `5.4.2` | | [@strapi/types](https://github.com/strapi/strapi) | `5.0.1` | `5.4.2` | | [@strapi/typescript-utils](https://github.com/strapi/strapi/tree/HEAD/packages/utils/typescript) | `5.0.1` | `5.4.2` | | @strapi/ui-primitives | `2.0.0-rc.11` | `2.0.0-rc.13` | | [@strapi/upload](https://github.com/strapi/strapi) | `5.0.1` | `5.4.2` | | [@strapi/utils](https://github.com/strapi/strapi) | `5.0.1` | `5.4.2` | Updates `@strapi/plugin-users-permissions` from 5.0.1 to 5.4.2 - [Release notes](https://github.com/strapi/strapi/releases) - [Commits](strapi/strapi@v5.0.1...v5.4.2) Updates `@strapi/strapi` from 5.0.1 to 5.4.2 - [Release notes](https://github.com/strapi/strapi/releases) - [Commits](strapi/strapi@v5.0.1...v5.4.2) Updates `meilisearch` from 0.36.0 to 0.45.0 - [Release notes](https://github.com/meilisearch/meilisearch-js/releases) - [Commits](meilisearch/meilisearch-js@v0.36.0...v0.45.0) Updates `@strapi/admin` from 5.0.1 to 5.4.2 - [Release notes](https://github.com/strapi/strapi/releases) - [Commits](strapi/strapi@v5.0.1...v5.4.2) Updates `@strapi/cloud-cli` from 5.0.1 to 5.4.2 - [Release notes](https://github.com/strapi/strapi/releases) - [Commits](strapi/strapi@v5.0.1...v5.4.2) Updates `@strapi/content-manager` from 5.0.1 to 5.4.2 - [Release notes](https://github.com/strapi/strapi/releases) - [Commits](strapi/strapi@v5.0.1...v5.4.2) Updates `@strapi/content-releases` from 5.0.1 to 5.4.2 - [Release notes](https://github.com/strapi/strapi/releases) - [Commits](strapi/strapi@v5.0.1...v5.4.2) Updates `@strapi/content-type-builder` from 5.0.1 to 5.4.2 - [Release notes](https://github.com/strapi/strapi/releases) - [Commits](strapi/strapi@v5.0.1...v5.4.2) Updates `@strapi/core` from 5.0.1 to 5.4.2 - [Release notes](https://github.com/strapi/strapi/releases) - [Commits](strapi/strapi@v5.0.1...v5.4.2) Updates `@strapi/data-transfer` from 5.0.1 to 5.4.2 Updates `@strapi/database` from 5.0.1 to 5.4.2 - [Release notes](https://github.com/strapi/strapi/releases) - [Commits](strapi/strapi@v5.0.1...v5.4.2) Updates `@strapi/design-system` from 2.0.0-rc.11 to 2.0.0-rc.13 Updates `@strapi/email` from 5.0.1 to 5.4.2 - [Release notes](https://github.com/strapi/strapi/releases) - [Commits](strapi/strapi@v5.0.1...v5.4.2) Updates `@strapi/generators` from 5.0.1 to 5.4.2 - [Release notes](https://github.com/strapi/strapi/releases) - [Commits](strapi/strapi@v5.0.1...v5.4.2) Updates `@strapi/i18n` from 5.0.1 to 5.4.2 - [Release notes](https://github.com/strapi/strapi/releases) - [Commits](https://github.com/strapi/strapi/commits/v5.4.2/packages/plugins/i18n) Updates `@strapi/icons` from 2.0.0-rc.11 to 2.0.0-rc.13 Updates `@strapi/logger` from 5.0.1 to 5.4.2 - [Release notes](https://github.com/strapi/strapi/releases) - [Commits](strapi/strapi@v5.0.1...v5.4.2) Updates `@strapi/permissions` from 5.0.1 to 5.4.2 - [Release notes](https://github.com/strapi/strapi/releases) - [Commits](strapi/strapi@v5.0.1...v5.4.2) Updates `@strapi/provider-email-sendmail` from 5.0.1 to 5.4.2 - [Release notes](https://github.com/strapi/strapi/releases) - [Commits](strapi/strapi@v5.0.1...v5.4.2) Updates `@strapi/provider-upload-local` from 5.0.1 to 5.4.2 - [Release notes](https://github.com/strapi/strapi/releases) - [Commits](strapi/strapi@v5.0.1...v5.4.2) Updates `@strapi/review-workflows` from 5.0.1 to 5.4.2 - [Release notes](https://github.com/strapi/strapi/releases) - [Commits](strapi/strapi@v5.0.1...v5.4.2) Updates `@strapi/types` from 5.0.1 to 5.4.2 - [Release notes](https://github.com/strapi/strapi/releases) - [Commits](strapi/strapi@v5.0.1...v5.4.2) Updates `@strapi/typescript-utils` from 5.0.1 to 5.4.2 - [Release notes](https://github.com/strapi/strapi/releases) - [Commits](https://github.com/strapi/strapi/commits/v5.4.2/packages/utils/typescript) Updates `@strapi/ui-primitives` from 2.0.0-rc.11 to 2.0.0-rc.13 Updates `@strapi/upload` from 5.0.1 to 5.4.2 - [Release notes](https://github.com/strapi/strapi/releases) - [Commits](strapi/strapi@v5.0.1...v5.4.2) Updates `@strapi/utils` from 5.0.1 to 5.4.2 - [Release notes](https://github.com/strapi/strapi/releases) - [Commits](strapi/strapi@v5.0.1...v5.4.2) --- updated-dependencies: - dependency-name: "@strapi/plugin-users-permissions" dependency-type: direct:production update-type: version-update:semver-minor dependency-group: playground - dependency-name: "@strapi/strapi" dependency-type: direct:production update-type: version-update:semver-minor dependency-group: playground - dependency-name: meilisearch dependency-type: direct:production update-type: version-update:semver-minor dependency-group: playground - dependency-name: "@strapi/admin" dependency-type: indirect update-type: version-update:semver-minor dependency-group: playground - dependency-name: "@strapi/cloud-cli" dependency-type: indirect update-type: version-update:semver-minor dependency-group: playground - dependency-name: "@strapi/content-manager" dependency-type: indirect update-type: version-update:semver-minor dependency-group: playground - dependency-name: "@strapi/content-releases" dependency-type: indirect update-type: version-update:semver-minor dependency-group: playground - dependency-name: "@strapi/content-type-builder" dependency-type: indirect update-type: version-update:semver-minor dependency-group: playground - dependency-name: "@strapi/core" dependency-type: indirect update-type: version-update:semver-minor dependency-group: playground - dependency-name: "@strapi/data-transfer" dependency-type: indirect update-type: version-update:semver-minor dependency-group: playground - dependency-name: "@strapi/database" dependency-type: indirect update-type: version-update:semver-minor dependency-group: playground - dependency-name: "@strapi/design-system" dependency-type: indirect update-type: version-update:semver-patch dependency-group: playground - dependency-name: "@strapi/email" dependency-type: indirect update-type: version-update:semver-minor dependency-group: playground - dependency-name: "@strapi/generators" dependency-type: indirect update-type: version-update:semver-minor dependency-group: playground - dependency-name: "@strapi/i18n" dependency-type: indirect update-type: version-update:semver-minor dependency-group: playground - dependency-name: "@strapi/icons" dependency-type: indirect update-type: version-update:semver-patch dependency-group: playground - dependency-name: "@strapi/logger" dependency-type: indirect update-type: version-update:semver-minor dependency-group: playground - dependency-name: "@strapi/permissions" dependency-type: indirect update-type: version-update:semver-minor dependency-group: playground - dependency-name: "@strapi/provider-email-sendmail" dependency-type: indirect update-type: version-update:semver-minor dependency-group: playground - dependency-name: "@strapi/provider-upload-local" dependency-type: indirect update-type: version-update:semver-minor dependency-group: playground - dependency-name: "@strapi/review-workflows" dependency-type: indirect update-type: version-update:semver-minor dependency-group: playground - dependency-name: "@strapi/types" dependency-type: indirect update-type: version-update:semver-minor dependency-group: playground - dependency-name: "@strapi/typescript-utils" dependency-type: indirect update-type: version-update:semver-minor dependency-group: playground - dependency-name: "@strapi/ui-primitives" dependency-type: indirect update-type: version-update:semver-patch dependency-group: playground - dependency-name: "@strapi/upload" dependency-type: indirect update-type: version-update:semver-minor dependency-group: playground - dependency-name: "@strapi/utils" dependency-type: indirect update-type: version-update:semver-minor dependency-group: playground ... Signed-off-by: dependabot[bot] <[email protected]>
…Tacture/strapi-plugin-meilisearch into feat/create-many-lifecycle-hook
@curquiza I rebased onto main (I hope I did it correctly). |
bors merge |
Pull Request
createMany
-Hook that is available sinceStrapi v4.9.0
, thecreateMany()
-Lifecycle hook properly returns a count and a set of ids after creation."peerDependencies": { "@strapi/strapi": "^4.9.0" }
Related issue
Fixes #965
Probably fixes #399 (I am not sure how tasks are updated upon restart)
What does this PR do?
PR checklist
Please check if your PR fulfills the following requirements:
Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
Have you read the contributing guidelines?
However, I could not lint since there would be changes in 67 to remove carriage-returns(
error Delete
␍prettier/prettier
)Have you made sure that the title is accurate and descriptive of the changes?
Thank you so much for contributing to Meilisearch!