aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Command
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2016-09-11 20:24:04 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-09-11 22:15:31 +0200
commit015c7a8359c950f9621b38b11c3973860a981da8 (patch)
treec9564ff38242df100e19f2de77d8d640599c0ea2 /src/Wallabag/ImportBundle/Command
parent7d862f83b95d24b4f081d73ca7b0bdf4435ae008 (diff)
downloadwallabag-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.php5
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;
5use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; 5use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
6use Symfony\Component\Config\Definition\Exception\Exception; 6use Symfony\Component\Config\Definition\Exception\Exception;
7use Symfony\Component\Console\Input\InputArgument; 7use Symfony\Component\Console\Input\InputArgument;
8use Symfony\Component\Console\Input\InputOption;
8use Symfony\Component\Console\Input\InputInterface; 9use Symfony\Component\Console\Input\InputInterface;
9use Symfony\Component\Console\Output\OutputInterface; 10use Symfony\Component\Console\Output\OutputInterface;
10use Simpleue\Worker\QueueWorker; 11use 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();