X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FImportBundle%2FCommand%2FRedisWorkerCommand.php;h=2d06af44732c4480c698b95b3339f1af1039a62c;hb=cebed9c01f20d47cb60259f0c002ea57a80da4d0;hp=85c5a9035ac578f8ca4e3778183710133f5d1bc3;hpb=b3437d58ae224121375c99e9288d8b808524e624;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php b/src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php index 85c5a903..2d06af44 100644 --- a/src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php +++ b/src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php @@ -5,6 +5,7 @@ namespace Wallabag\ImportBundle\Command; use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; use Symfony\Component\Config\Definition\Exception\Exception; use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Simpleue\Worker\QueueWorker; @@ -16,7 +17,8 @@ class RedisWorkerCommand extends ContainerAwareCommand $this ->setName('wallabag:import:redis-worker') ->setDescription('Launch Redis worker') - ->addArgument('serviceName', InputArgument::REQUIRED, 'Service to use: wallabag_v1, wallabag_v2, pocket or readability') + ->addArgument('serviceName', InputArgument::REQUIRED, 'Service to use: wallabag_v1, wallabag_v2, pocket, readability, pinboard, firefox, chrome or instapaper') + ->addOption('maxIterations', '', InputOption::VALUE_OPTIONAL, 'Number of iterations before stoping', false) ; } @@ -33,7 +35,8 @@ class RedisWorkerCommand extends ContainerAwareCommand $worker = new QueueWorker( $this->getContainer()->get('wallabag_import.queue.redis.'.$serviceName), - $this->getContainer()->get('wallabag_import.consumer.redis.'.$serviceName) + $this->getContainer()->get('wallabag_import.consumer.redis.'.$serviceName), + (int) $input->getOption('maxIterations') ); $worker->start();