aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php
diff options
context:
space:
mode:
authorJérémy Benoist <j0k3r@users.noreply.github.com>2017-10-23 11:09:17 +0200
committerGitHub <noreply@github.com>2017-10-23 11:09:17 +0200
commit1953a872932a63792293b4aec087880265ba89f7 (patch)
treefd16599e737fcdaf193c933ef3ec4a4ee248b117 /src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php
parentd83d25dadec2c38460a32d96f5d2903426fec9d3 (diff)
parent702f2d67d60ca963492b90dad74cb5f8dcc84e51 (diff)
downloadwallabag-1953a872932a63792293b4aec087880265ba89f7.tar.gz
wallabag-1953a872932a63792293b4aec087880265ba89f7.tar.zst
wallabag-1953a872932a63792293b4aec087880265ba89f7.zip
Merge pull request #3011 from wallabag/2.3
wallabag 2.3.0
Diffstat (limited to 'src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php')
-rw-r--r--src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php b/src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php
index 2d06af44..d94900ad 100644
--- a/src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php
+++ b/src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php
@@ -2,13 +2,13 @@
2 2
3namespace Wallabag\ImportBundle\Command; 3namespace Wallabag\ImportBundle\Command;
4 4
5use Simpleue\Worker\QueueWorker;
5use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; 6use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
6use Symfony\Component\Config\Definition\Exception\Exception; 7use Symfony\Component\Config\Definition\Exception\Exception;
7use Symfony\Component\Console\Input\InputArgument; 8use Symfony\Component\Console\Input\InputArgument;
8use Symfony\Component\Console\Input\InputOption;
9use Symfony\Component\Console\Input\InputInterface; 9use Symfony\Component\Console\Input\InputInterface;
10use Symfony\Component\Console\Input\InputOption;
10use Symfony\Component\Console\Output\OutputInterface; 11use Symfony\Component\Console\Output\OutputInterface;
11use Simpleue\Worker\QueueWorker;
12 12
13class RedisWorkerCommand extends ContainerAwareCommand 13class RedisWorkerCommand extends ContainerAwareCommand
14{ 14{
@@ -24,18 +24,18 @@ class RedisWorkerCommand extends ContainerAwareCommand
24 24
25 protected function execute(InputInterface $input, OutputInterface $output) 25 protected function execute(InputInterface $input, OutputInterface $output)
26 { 26 {
27 $output->writeln('Worker started at: '.(new \DateTime())->format('d-m-Y G:i:s')); 27 $output->writeln('Worker started at: ' . (new \DateTime())->format('d-m-Y G:i:s'));
28 $output->writeln('Waiting for message ...'); 28 $output->writeln('Waiting for message ...');
29 29
30 $serviceName = $input->getArgument('serviceName'); 30 $serviceName = $input->getArgument('serviceName');
31 31
32 if (!$this->getContainer()->has('wallabag_import.queue.redis.'.$serviceName) || !$this->getContainer()->has('wallabag_import.consumer.redis.'.$serviceName)) { 32 if (!$this->getContainer()->has('wallabag_import.queue.redis.' . $serviceName) || !$this->getContainer()->has('wallabag_import.consumer.redis.' . $serviceName)) {
33 throw new Exception(sprintf('No queue or consumer found for service name: "%s"', $input->getArgument('serviceName'))); 33 throw new Exception(sprintf('No queue or consumer found for service name: "%s"', $input->getArgument('serviceName')));
34 } 34 }
35 35
36 $worker = new QueueWorker( 36 $worker = new QueueWorker(
37 $this->getContainer()->get('wallabag_import.queue.redis.'.$serviceName), 37 $this->getContainer()->get('wallabag_import.queue.redis.' . $serviceName),
38 $this->getContainer()->get('wallabag_import.consumer.redis.'.$serviceName), 38 $this->getContainer()->get('wallabag_import.consumer.redis.' . $serviceName),
39 (int) $input->getOption('maxIterations') 39 (int) $input->getOption('maxIterations')
40 ); 40 );
41 41