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

Feature/add automatic reindex manager #138

Merged

Conversation

delyriand
Copy link
Member

  • feat: add an automatic reindex manager to enable or disable event
  • fix: reset the dispatch flag in the event subscribe on clear event

For example, when we have an import product service and have multiple flush, we want to send a reindex message at the end manually. Now, is it possible:

...
// Disable the automatic product search reindex
$this->automaticProductReindexManager->shouldAutomaticallyReindex(false);

...
// Dispatch a message to reindex my current product
$productReindexFromIdsMessage = new ProductReindexFromIds();
$productReindexFromIdsMessage->addProductId($product->getId());
$this->messageBus->dispatch($productReindexFromIdsMessage);

// Re-enable the automatic product search reindex
$this->automaticProductReindexManager->shouldAutomaticallyReindex(true);

@delyriand delyriand force-pushed the feature/add-automatic-reindex-manager branch from e02d90d to f4a7ff3 Compare September 20, 2022 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants