private function run(TaskExecutionInterface $execution)
    {
        $start = microtime(true);
        $execution->setStartTime(new \DateTime());
        $execution->setStatus(TaskStatus::RUNNING);
        $this->taskExecutionRepository->save($execution);

        try {
            $execution = $this->hasPassed($execution, $this->handle($execution));
        } catch (ExitException $exception) {
            throw $exception;
        } catch (\Exception $exception) {
            $execution = $this->hasFailed($execution, $exception);
        } finally {
            $this->finalize($execution, $start);
        }
    }
private function run(TaskExecutionInterface $execution)
    {
        $start = microtime(true);
        $execution->setStartTime(new \DateTime());
        $execution->setStatus(TaskStatus::RUNNING);
        $this->taskExecutionRepository->save($execution);

        try {
            $execution = $this->hasPassed($execution, $this->handle($execution));
        } catch (ExitException $exception) {
            throw $exception;
        } catch (\Exception $exception) {
            $execution = $this->hasFailed($execution, $exception);
        } finally {
            $this->finalize($execution, $start);
        }
    }
private function run ( TaskExecutionInterface $ execution ) { $ start = microtime ( true ) ; $ execution -> setStartTime ( new \ DateTime ( ) ) ; $ execution -> setStatus ( TaskStatus :: RUNNING ) ; $ this -> taskExecutionRepository -> save ( $ execution ) ; try { $ execution = $ this -> hasPassed ( $ execution , $ this -> handle ( $ execution ) ) ; } catch ( ExitException $ exception ) { throw $ exception ; } catch ( \ Exception $ exception ) { $ execution = $ this -> hasFailed ( $ execution , $ exception ) ; } finally { $ this -> finalize ( $ execution , $ start ) ; } }
Run execution with given handler.

@param TaskExecutionInterface $execution

@throws ExitException
Run execution with given handler .