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

updateContentTypeInMeiliSearch duplicates lifecycle methods #925

Open
jbendkowski opened this issue May 24, 2024 · 1 comment
Open

updateContentTypeInMeiliSearch duplicates lifecycle methods #925

jbendkowski opened this issue May 24, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@jbendkowski
Copy link

Description
Based on my experience with the Meilisearch plugin, it appears that multiple invocations of the service updateContentTypeInMeiliSearch method (which adds all entries from a contentType) cause each index update to be executed as many times as the addContentTypeInMeiliSearch method has been called since the server was started. I suggest adding a check to skip lifecycle subscriptions if the contentType has already been added. This could prevent the duplication of lifecycle methods and ensure that each index update is only executed once.

Environment:

  • OS: Windows 10
  • strapi-plugin-meilisearch version: 0.12.0
  • Strapi version: 4.24.2
@curquiza curquiza added enhancement New feature or request good first issue Good for newcomers labels Jul 10, 2024
@francois-demory
Copy link

I was going to post the same issue.
Moreover, when you update the index from the plugin settings with the "update" button. It duplicates the subscription too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants