@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $em->flush(); |
| 54 | 54 | |
| 55 | 55 | $end = microtime(true); |
| 56 | - $duration = sprintf('%0.2f', $end - $start); |
|
| 56 | + $duration = sprintf('%0.2f', $end-$start); |
|
| 57 | 57 | $output->writeln("Cron run completed in $duration seconds"); |
| 58 | 58 | } |
| 59 | 59 | |
@@ -100,11 +100,11 @@ discard block |
||
| 100 | 100 | $statusStr = 'failed'; |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - $durationStr = sprintf('%0.2f', $jobEnd - $jobStart); |
|
| 103 | + $durationStr = sprintf('%0.2f', $jobEnd-$jobStart); |
|
| 104 | 104 | $output->writeln("$statusStr in $durationStr seconds"); |
| 105 | 105 | |
| 106 | 106 | // Record the result |
| 107 | - $this->recordJobResult($em, $job, $jobEnd - $jobStart, $jobOutput->getOutput(), $returnCode); |
|
| 107 | + $this->recordJobResult($em, $job, $jobEnd-$jobStart, $jobOutput->getOutput(), $returnCode); |
|
| 108 | 108 | |
| 109 | 109 | // And update the job with it's next scheduled time |
| 110 | 110 | $newTime = new \DateTime(); |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Alpixel\Bundle\CronBundle\Entity\CronJob; |
| 6 | 6 | use Alpixel\Bundle\CronBundle\Entity\CronJobResult; |
| 7 | -use Doctrine\ORM\EntityManager; |
|
| 8 | 7 | use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; |
| 9 | 8 | use Symfony\Component\Console\Input\ArgvInput; |
| 10 | 9 | use Symfony\Component\Console\Input\InputArgument; |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Alpixel\Bundle\CronBundle\Annotation\CronJob as CronJobAnno; |
| 6 | 6 | use Alpixel\Bundle\CronBundle\Entity\CronJob; |
| 7 | -use Doctrine\ORM\EntityManager; |
|
| 8 | 7 | use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; |
| 9 | 8 | use Symfony\Component\Console\Command\Command; |
| 10 | 9 | use Symfony\Component\Console\Input\InputInterface; |