Skip to content
This repository was archived by the owner on Feb 6, 2022. It is now read-only.

Commit 4b90392

Browse files
committed
Flush spool queue for console terminate as well
1 parent 1c87809 commit 4b90392

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

EventListener/EmailSenderListener.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\DependencyInjection\IntrospectableContainerInterface;
1616
use Symfony\Component\HttpKernel\Event\PostResponseEvent;
1717
use Symfony\Component\HttpKernel\KernelEvents;
18+
use Symfony\Component\Console\ConsoleEvents;
1819
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
1920

2021
/**
@@ -33,7 +34,7 @@ public function __construct(ContainerInterface $container)
3334
$this->container = $container;
3435
}
3536

36-
public function onKernelTerminate(PostResponseEvent $event)
37+
public function onTerminate($event)
3738
{
3839
if (!$this->container->has('mailer')) {
3940
return;
@@ -57,6 +58,9 @@ public function onKernelTerminate(PostResponseEvent $event)
5758

5859
static public function getSubscribedEvents()
5960
{
60-
return array(KernelEvents::TERMINATE => 'onKernelTerminate');
61+
return array(
62+
KernelEvents::TERMINATE => 'onTerminate',
63+
ConsoleEvents::TERMINATE => 'onTerminate'
64+
);
6165
}
6266
}

0 commit comments

Comments
 (0)