@@ -2,11 +2,9 @@ |
||
| 2 | 2 | namespace Dtc\QueueBundle\Command; |
| 3 | 3 | |
| 4 | 4 | use Dtc\QueueBundle\Documents\Job; |
| 5 | - |
|
| 6 | 5 | use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; |
| 7 | 6 | use Symfony\Component\Console\Input\InputArgument; |
| 8 | 7 | use Symfony\Component\Console\Input\InputInterface; |
| 9 | -use Symfony\Component\Console\Input\InputOption; |
|
| 10 | 8 | use Symfony\Component\Console\Output\OutputInterface; |
| 11 | 9 | |
| 12 | 10 | class CreateJobCommand |
@@ -2,9 +2,7 @@ |
||
| 2 | 2 | namespace Dtc\QueueBundle\Command; |
| 3 | 3 | |
| 4 | 4 | use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; |
| 5 | -use Symfony\Component\Console\Input\InputArgument; |
|
| 6 | 5 | use Symfony\Component\Console\Input\InputInterface; |
| 7 | -use Symfony\Component\Console\Input\InputOption; |
|
| 8 | 6 | use Symfony\Component\Console\Output\OutputInterface; |
| 9 | 7 | |
| 10 | 8 | class PruneCommand |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | namespace Dtc\QueueBundle\Command; |
| 3 | 3 | |
| 4 | 4 | use Dtc\QueueBundle\Model\Job; |
| 5 | - |
|
| 6 | 5 | use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; |
| 7 | 6 | use Symfony\Component\Console\Input\InputArgument; |
| 8 | 7 | use Symfony\Component\Console\Input\InputInterface; |
@@ -3,10 +3,7 @@ |
||
| 3 | 3 | |
| 4 | 4 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; |
| 5 | 5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; |
| 6 | - |
|
| 7 | 6 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
| 8 | -use Symfony\Component\HttpFoundation\Response; |
|
| 9 | -use Symfony\Component\HttpFoundation\Request; |
|
| 10 | 7 | |
| 11 | 8 | class QueueController |
| 12 | 9 | extends Controller |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | |
| 4 | 4 | use Dtc\QueueBundle\Model\Job as BaseJob; |
| 5 | 5 | use Dtc\QueueBundle\Model\JobManagerInterface; |
| 6 | - |
|
| 7 | 6 | use PhpAmqpLib\Connection\AMQPConnection; |
| 8 | 7 | use PhpAmqpLib\Message\AMQPMessage; |
| 9 | 8 | |
@@ -57,8 +57,7 @@ |
||
| 57 | 57 | if ($job->getStatus() === BaseJob::STATUS_SUCCESS) { |
| 58 | 58 | $this->beanstalkd |
| 59 | 59 | ->delete($job); |
| 60 | - } |
|
| 61 | - else { |
|
| 60 | + } else { |
|
| 62 | 61 | $this->beanstalkd |
| 63 | 62 | ->bury($job); |
| 64 | 63 | } |
@@ -3,12 +3,8 @@ |
||
| 3 | 3 | |
| 4 | 4 | use Dtc\QueueBundle\Tests\Model\BaseJobManagerTest; |
| 5 | 5 | use Dtc\QueueBundle\Tests\FibonacciWorker; |
| 6 | -use Dtc\QueueBundle\Tests\StaticJobManager; |
|
| 7 | - |
|
| 8 | -use Dtc\QueueBundle\Model\WorkerManager; |
|
| 9 | 6 | use Dtc\QueueBundle\Documents\JobManager; |
| 10 | 7 | use Dtc\QueueBundle\Model\Job; |
| 11 | - |
|
| 12 | 8 | use Doctrine\MongoDB\Connection; |
| 13 | 9 | use Doctrine\ODM\MongoDB\Configuration; |
| 14 | 10 | use Doctrine\ODM\MongoDB\DocumentManager; |
@@ -2,9 +2,6 @@ |
||
| 2 | 2 | namespace Dtc\QueueBundle\Tests\Model; |
| 3 | 3 | |
| 4 | 4 | use Dtc\QueueBundle\Model\Job; |
| 5 | -use Dtc\QueueBundle\Tests\FibonacciWorker; |
|
| 6 | -use Dtc\QueueBundle\Tests\StaticJobManager; |
|
| 7 | -use Dtc\QueueBundle\Model\WorkerManager; |
|
| 8 | 5 | |
| 9 | 6 | class BaseJobManagerTest |
| 10 | 7 | extends \PHPUnit_Framework_TestCase |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | use Dtc\QueueBundle\Model\Job; |
| 5 | 5 | use Dtc\QueueBundle\Tests\FibonacciWorker; |
| 6 | 6 | use Dtc\QueueBundle\Tests\StaticJobManager; |
| 7 | -use Dtc\QueueBundle\Model\WorkerManager; |
|
| 8 | 7 | |
| 9 | 8 | class JobTest |
| 10 | 9 | extends \PHPUnit_Framework_TestCase |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | use Dtc\QueueBundle\Model\Job; |
| 5 | 5 | use Dtc\QueueBundle\Tests\FibonacciWorker; |
| 6 | 6 | use Dtc\QueueBundle\Tests\StaticJobManager; |
| 7 | -use Dtc\QueueBundle\Model\WorkerManager; |
|
| 8 | 7 | |
| 9 | 8 | class WorkerTest |
| 10 | 9 | extends \PHPUnit_Framework_TestCase |
@@ -115,8 +115,7 @@ |
||
| 115 | 115 | if ($priority) { |
| 116 | 116 | $this->assertEquals($priority, $job->getPriority(), |
| 117 | 117 | "Priority should be the same."); |
| 118 | - } |
|
| 119 | - else { |
|
| 118 | + } else { |
|
| 120 | 119 | $this->assertNull($job->getPriority(), "Priority should be null"); |
| 121 | 120 | } |
| 122 | 121 | |