|
4 | 4 |
|
5 | 5 | use IdeasBucket\QueueBundle\Listener; |
6 | 6 | use IdeasBucket\QueueBundle\ListenerOptions; |
7 | | -use Symfony\Component\Console\Command\Command; |
| 7 | +use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; |
8 | 8 | use Symfony\Component\Console\Input\InputArgument; |
9 | 9 | use Symfony\Component\Console\Input\InputOption; |
10 | 10 | use Symfony\Component\Console\Output\OutputInterface; |
|
15 | 15 | * |
16 | 16 | * @package IdeasBucket\QueueBundle\Command |
17 | 17 | */ |
18 | | -class ListenCommand extends Command |
| 18 | +class ListenCommand extends ContainerAwareCommand |
19 | 19 | { |
20 | 20 | /** |
21 | 21 | * Listener which listens for the incoming job. |
@@ -54,7 +54,6 @@ protected function configure() |
54 | 54 | ->addArgument('connection', InputArgument::OPTIONAL, 'The name of connection') |
55 | 55 | ->addOption('queue', null, InputOption::VALUE_OPTIONAL, 'The queue to listen on', null) |
56 | 56 | ->addOption('delay', null, InputOption::VALUE_OPTIONAL, 'Amount of time to delay failed jobs', 0) |
57 | | - ->addOption('env', null, InputOption::VALUE_OPTIONAL, 'Environment that we need to run in', null) |
58 | 57 | ->addOption('memory', null, InputOption::VALUE_OPTIONAL, 'The memory limit in megabytes', 128) |
59 | 58 | ->addOption('timeout', null, InputOption::VALUE_OPTIONAL, 'Seconds a job may run before timing out', 60) |
60 | 59 | ->addOption('sleep', null, InputOption::VALUE_OPTIONAL, 'Seconds to wait before checking queue for jobs', 3) |
@@ -134,7 +133,7 @@ protected function getQueue($queueName, $connection) |
134 | 133 | protected function gatherOptions(InputInterface $input) |
135 | 134 | { |
136 | 135 | return new ListenerOptions( |
137 | | - $input->getOption('env'), |
| 136 | + $this->getContainer()->getParameter('kernel.environment'), |
138 | 137 | $input->getOption('delay'), |
139 | 138 | $input->getOption('memory'), |
140 | 139 | $input->getOption('timeout'), |
|
0 commit comments