strapi-plugin-meilisearch icon indicating copy to clipboard operation
strapi-plugin-meilisearch copied to clipboard

updateContentTypeInMeiliSearch duplicates lifecycle methods

Open jbendkowski opened this issue 1 year ago • 1 comments

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

jbendkowski avatar May 24 '24 12:05 jbendkowski

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.

francois-demory avatar Oct 17 '24 12:10 francois-demory