Completed
Push — master ( 55a9c0...ed128c )
by Emil
14:56
created

RunCommand::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 2
1
<?php
2
3
namespace Glooby\TaskBundle\Command\Scheduler;
4
5
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
6
use Symfony\Component\Console\Input\InputInterface;
7
use Symfony\Component\Console\Output\OutputInterface;
8
9
/**
10
 * @author Emil Kilhage
11
 */
12
class RunCommand extends ContainerAwareCommand
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17
    protected function configure()
18
    {
19
        $this->setName('scheduler:run');
20
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    protected function execute(InputInterface $input, OutputInterface $output)
26
    {
27
        $runner = $this->getContainer()->get('glooby_task.queue_processor');
28
        $runner->setOutput($output);
29
        $runner->process();
30
31
        $scheduler = $this->getContainer()->get('glooby_task.queue_scheduler');
32
        $scheduler->schedule();
33
    }
34
}
35