diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-09-11 20:24:04 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-09-11 22:15:31 +0200 |
commit | 015c7a8359c950f9621b38b11c3973860a981da8 (patch) | |
tree | c9564ff38242df100e19f2de77d8d640599c0ea2 /src/Wallabag/ImportBundle/Command | |
parent | 7d862f83b95d24b4f081d73ca7b0bdf4435ae008 (diff) | |
download | wallabag-015c7a8359c950f9621b38b11c3973860a981da8.tar.gz wallabag-015c7a8359c950f9621b38b11c3973860a981da8.tar.zst wallabag-015c7a8359c950f9621b38b11c3973860a981da8.zip |
Add more tests
And ability to define how many messages can be hanle by the redis worker before stopping (usefull for tests)
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(); |