Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add a "recover-timeout" option to allow recovering messages that have…

… taken too long to send
  • Loading branch information...
commit 15c666bf436748e005127207f46a9a2289a5b234 1 parent f842739
Ryan authored
4 src/Symfony/Bundle/SwiftmailerBundle/Command/SendEmailCommand.php
@@ -34,10 +34,11 @@ protected function configure()
34 34 ->setDescription('Sends emails from the spool')
35 35 ->addOption('message-limit', 0, InputOption::VALUE_OPTIONAL, 'The maximum number of messages to send.')
36 36 ->addOption('time-limit', 0, InputOption::VALUE_OPTIONAL, 'The time limit for sending messages (in seconds).')
  37 + ->addOption('recover-timeout', 0, InputOption::VALUE_OPTIONAL, 'The timeout for recovering messages that have taken too long to send (in seconds).')
37 38 ->setHelp(<<<EOF
38 39 The <info>swiftmailer:spool:send</info> command sends all emails from the spool.
39 40
40   -<info>php app/console swiftmailer:spool:send --message-limit=10 --time-limit=10</info>
  41 +<info>php app/console swiftmailer:spool:send --message-limit=10 --time-limit=10 --recover-timeout=900</info>
41 42
42 43 EOF
43 44 )
@@ -57,6 +58,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
57 58 if ($spool instanceof \Swift_ConfigurableSpool) {
58 59 $spool->setMessageLimit($input->getOption('message-limit'));
59 60 $spool->setTimeLimit($input->getOption('time-limit'));
  61 + NULL !== $input->getOption('recover-timeout') ? $spool->recover($input->getOption('recover-timeout')) : $spool->recover();
60 62 }
61 63 $sent = $spool->flushQueue($this->getContainer()->get('swiftmailer.transport.real'));
62 64

0 comments on commit 15c666b

Please sign in to comment.
Something went wrong with that request. Please try again.