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

Add event listener on job complete that flushes the swiftmailer spool #176

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dol
Copy link

@dol dol commented Apr 6, 2017

When starting with a default symfony project the swiftmailer is set-upped to use spool for sending out mails.
https://github.com/symfony/symfony-standard/blob/7a885f1dcd2f5191f19470866aca9a472770ebcf/app/config/config.yml#L69

The spool is only flushed sent out on the kernel terminate event. When using this bundle the kernel terminate event won't be triggered. This will block the emails in memory and they are never released. A Ctrl+C will interrupt the worker but not flushing the email either.

By adding a custom EventListener to the bundle this issue could be fixed.
An other approach would be creating a specialized SwiftMailerGearmanBundle that deals with GearmanBundle events and flushes the SwiftMailer spool. But this is kind of an overload.

@dol dol force-pushed the feature/flushSwiftmailerSpoolOnCompletion branch from 6e91f14 to 7fbb6e1 Compare April 7, 2017 07:10
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 this pull request may close these issues.

1 participant