src/JobQueue.php
public function run($queue)
    {
        $configuration = $this->getConfiguration($queue);
        
        if (null === $configuration) {
            return;
        }

        try {
            $job = $this->getJob($configuration);
            $configuration->increaseOrderNr();

            $this->saveJobState($configuration, JobState::STATE_RUNNING);

            $report = $this->reportManager->create($configuration);
            $state = $job->run($report);

            if (JobState::STATE_FINISHED === $state) {
                $configuration->setNextStart(new \DateTime('+' . $configuration->getPeriod() . ' seconds'));
                $report->setSuccessful(true);
            }

            $report->setEndedAt();

            $this->saveJobState($configuration, $state);
        } catch (JobFactoryException $e) {
            $this->saveJobState($configuration, JobState::STATE_FAILED);
        }
    }
public function run($queue)
    {
        $configuration = $this->getConfiguration($queue);
        
        if (null === $configuration) {
            return;
        }

        try {
            $job = $this->getJob($configuration);
            $configuration->increaseOrderNr();

            $this->saveJobState($configuration, JobState::STATE_RUNNING);

            $report = $this->reportManager->create($configuration);
            $state = $job->run($report);

            if (JobState::STATE_FINISHED === $state) {
                $configuration->setNextStart(new \DateTime('+' . $configuration->getPeriod() . ' seconds'));
                $report->setSuccessful(true);
            }

            $report->setEndedAt();

            $this->saveJobState($configuration, $state);
        } catch (JobFactoryException $e) {
            $this->saveJobState($configuration, JobState::STATE_FAILED);
        }
    }
public function run ( $ queue ) { $ configuration = $ this -> getConfiguration ( $ queue ) ; if ( null === $ configuration ) { return ; } try { $ job = $ this -> getJob ( $ configuration ) ; $ configuration -> increaseOrderNr ( ) ; $ this -> saveJobState ( $ configuration , JobState :: STATE_RUNNING ) ; $ report = $ this -> reportManager -> create ( $ configuration ) ; $ state = $ job -> run ( $ report ) ; if ( JobState :: STATE_FINISHED === $ state ) { $ configuration -> setNextStart ( new \ DateTime ( '+' . $ configuration -> getPeriod ( ) . ' seconds' ) ) ; $ report -> setSuccessful ( true ) ; } $ report -> setEndedAt ( ) ; $ this -> saveJobState ( $ configuration , $ state ) ; } catch ( JobFactoryException $ e ) { $ this -> saveJobState ( $ configuration , JobState :: STATE_FAILED ) ; } }
Run job queue.

@param string $queue
Run job queue .