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

Bug: Duplicate messages are added to image_conversion queue #1216

Open
kottkrig opened this issue Dec 3, 2021 · 1 comment
Open

Bug: Duplicate messages are added to image_conversion queue #1216

kottkrig opened this issue Dec 3, 2021 · 1 comment

Comments

@kottkrig
Copy link
Contributor

kottkrig commented Dec 3, 2021

Current behaviour

Duplicate messages are added to the image_conversion RabbitMQ queue.

How to test

  1. Publish an article with media
  2. Observe that the rabbitmq message queue increases with the number of renditions for the media. E.g 16 renditions results in 16 messages on the queue.
  3. Publish an article without media
  4. Observe that the rabbitmq message queue still increases with the same number of messages from step 2.

Possible culprit?

This listener isn't removed. Could this result in a new listener/callback each time a new post is persisted to the database?

$this->eventDispatcher->addListener(PackageEvents::PACKAGE_PROCESSED, function (GenericEvent $event) use ($rendition, $tenantId) {
$this->messageBus->dispatch(new ConvertImageMessage(
(int) $rendition->getImage()->getId(),
(int) $tenantId
));
});

@takeit
Copy link
Contributor

takeit commented Jan 13, 2022

That could be it. Can you try commenting that out when doing step 3 and see if the messages will be added to the queue? But in general, this listener should not be called when there are no renditions/images in the article you publish, unless it still references the old images.

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

No branches or pull requests

2 participants