added explicit swiftmailer flush after ConsoleEvents::TERMINATE
This commit is contained in:
parent
9dc14a5c2b
commit
9bb602fdd5
@ -12,6 +12,7 @@
|
|||||||
namespace Symfony\Bridge\Monolog\Handler;
|
namespace Symfony\Bridge\Monolog\Handler;
|
||||||
|
|
||||||
use Monolog\Handler\SwiftMailerHandler as BaseSwiftMailerHandler;
|
use Monolog\Handler\SwiftMailerHandler as BaseSwiftMailerHandler;
|
||||||
|
use Symfony\Component\Console\Event\ConsoleTerminateEvent;
|
||||||
use Symfony\Component\HttpKernel\Event\PostResponseEvent;
|
use Symfony\Component\HttpKernel\Event\PostResponseEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -43,6 +44,16 @@ class SwiftMailerHandler extends BaseSwiftMailerHandler
|
|||||||
$this->instantFlush = true;
|
$this->instantFlush = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* After the CLI application has been terminated we will always flush messages
|
||||||
|
*
|
||||||
|
* @param ConsoleTerminateEvent $event
|
||||||
|
*/
|
||||||
|
public function onCliTerminate(ConsoleTerminateEvent $event)
|
||||||
|
{
|
||||||
|
$this->instantFlush = true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user