diff options
Diffstat (limited to 'src/Wallabag/ImportBundle/Command')
-rw-r--r-- | src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php b/src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php index 85c5a903..5f90e00f 100644 --- a/src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php +++ b/src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php | |||
@@ -5,6 +5,7 @@ namespace Wallabag\ImportBundle\Command; | |||
5 | use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; | 5 | use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; |
6 | use Symfony\Component\Config\Definition\Exception\Exception; | 6 | use Symfony\Component\Config\Definition\Exception\Exception; |
7 | use Symfony\Component\Console\Input\InputArgument; | 7 | use Symfony\Component\Console\Input\InputArgument; |
8 | use Symfony\Component\Console\Input\InputOption; | ||
8 | use Symfony\Component\Console\Input\InputInterface; | 9 | use Symfony\Component\Console\Input\InputInterface; |
9 | use Symfony\Component\Console\Output\OutputInterface; | 10 | use Symfony\Component\Console\Output\OutputInterface; |
10 | use Simpleue\Worker\QueueWorker; | 11 | use Simpleue\Worker\QueueWorker; |
@@ -17,6 +18,7 @@ class RedisWorkerCommand extends ContainerAwareCommand | |||
17 | ->setName('wallabag:import:redis-worker') | 18 | ->setName('wallabag:import:redis-worker') |
18 | ->setDescription('Launch Redis worker') | 19 | ->setDescription('Launch Redis worker') |
19 | ->addArgument('serviceName', InputArgument::REQUIRED, 'Service to use: wallabag_v1, wallabag_v2, pocket or readability') | 20 | ->addArgument('serviceName', InputArgument::REQUIRED, 'Service to use: wallabag_v1, wallabag_v2, pocket or readability') |
21 | ->addOption('maxIterations', '', InputOption::VALUE_OPTIONAL, 'Number of iterations before stoping', false) | ||
20 | ; | 22 | ; |
21 | } | 23 | } |
22 | 24 | ||
@@ -33,7 +35,8 @@ class RedisWorkerCommand extends ContainerAwareCommand | |||
33 | 35 | ||
34 | $worker = new QueueWorker( | 36 | $worker = new QueueWorker( |
35 | $this->getContainer()->get('wallabag_import.queue.redis.'.$serviceName), | 37 | $this->getContainer()->get('wallabag_import.queue.redis.'.$serviceName), |
36 | $this->getContainer()->get('wallabag_import.consumer.redis.'.$serviceName) | 38 | $this->getContainer()->get('wallabag_import.consumer.redis.'.$serviceName), |
39 | $input->getOption('maxIterations') | ||
37 | ); | 40 | ); |
38 | 41 | ||
39 | $worker->start(); | 42 | $worker->start(); |