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

Hook into createMany lifecycle hook #965

Open
Ra0R opened this issue Oct 29, 2024 · 0 comments · May be fixed by #972
Open

Hook into createMany lifecycle hook #965

Ra0R opened this issue Oct 29, 2024 · 0 comments · May be fixed by #972

Comments

@Ra0R
Copy link

Ra0R commented Oct 29, 2024

We sync around ~15k documents every day into our meilisearch index. Adding them to the index one-by-one takes a long time. (How it is currently handled with create-Lifecycle hook.

Here are the changes I would suggest:

Since Strapi v4.9.0, the createMany()-Lifecycle hook properly returns a count and a set of ids after creation:

e.g.

 { count: 2 , ids: [1,2]}

This should be properly handled in this part of the code:
https://github.com/meilisearch/strapi-plugin-meilisearch/blob/f47f50a86ee189ec36d1fc8b2a7a1140a847abba/server/services/lifecycle/lifecycle.js#L45C1-L49C11

Either check for Strapi Version or update package.json with "peerDependency": { "Strapi": "^4.9.0"}

Let me know if I can implement this.

@Ra0R Ra0R linked a pull request Nov 4, 2024 that will close this issue
3 tasks
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 a pull request may close this issue.

1 participant