Skip to content
This repository has been archived by the owner on Jul 4, 2018. It is now read-only.

Commit

Permalink
Verify that the spool is enabled and an actual spool before flushing it
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Sep 2, 2015
1 parent 647ccdf commit 41c6212
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Silex/Provider/SwiftmailerServiceProvider.php
Expand Up @@ -91,7 +91,7 @@ public function boot(Application $app)
$app->finish(function () use ($app) {
// To speed things up (by avoiding Swift Mailer initialization), flush
// messages only if our mailer has been created (potentially used)
if ($app['mailer.initialized']) {
if ($app['mailer.initialized'] && $app['swiftmailer.use_spool'] && $app['swiftmailer.spooltransport'] instanceof \Swift_Transport_SpoolTransport) {
$app['swiftmailer.spooltransport']->getSpool()->flushQueue($app['swiftmailer.transport']);
}
});
Expand Down

0 comments on commit 41c6212

Please sign in to comment.