public function onConsoleTerminate(ConsoleTerminateEvent $event)
    {
        $call = $this->callRepository->find($_REQUEST['call_id']);

        if (!$call->getStatus()) {
            $call->setStatus(Call::STATUS_SUCCESS);
        }

        if ($event->getExitCode()) {
            $call->setStatus(Call::STATUS_ABORTED);
            $call->setOutput(sprintf('Command finished with exit code: %s', $event->getExitCode()));

            $this->registerError($call);
        }

        $call->setFinishedAt(new \DateTime());
        $call->setExecutionTime($call->getExecutionTime());
        $this->callRepository->update($call);

        $this->processRepository->countAvgExecutionTime($call->getProcess(), $call->getExecutionTime());
        $this->processRepository->update($call->getProcess());
    }
public function onConsoleTerminate(ConsoleTerminateEvent $event)
    {
        $call = $this->callRepository->find($_REQUEST['call_id']);

        if (!$call->getStatus()) {
            $call->setStatus(Call::STATUS_SUCCESS);
        }

        if ($event->getExitCode()) {
            $call->setStatus(Call::STATUS_ABORTED);
            $call->setOutput(sprintf('Command finished with exit code: %s', $event->getExitCode()));

            $this->registerError($call);
        }

        $call->setFinishedAt(new \DateTime());
        $call->setExecutionTime($call->getExecutionTime());
        $this->callRepository->update($call);

        $this->processRepository->countAvgExecutionTime($call->getProcess(), $call->getExecutionTime());
        $this->processRepository->update($call->getProcess());
    }
public function onConsoleTerminate ( ConsoleTerminateEvent $ event ) { $ call = $ this -> callRepository -> find ( $ _REQUEST [ 'call_id' ] ) ; if ( ! $ call -> getStatus ( ) ) { $ call -> setStatus ( Call :: STATUS_SUCCESS ) ; } if ( $ event -> getExitCode ( ) ) { $ call -> setStatus ( Call :: STATUS_ABORTED ) ; $ call -> setOutput ( sprintf ( 'Command finished with exit code: %s' , $ event -> getExitCode ( ) ) ) ; $ this -> registerError ( $ call ) ; } $ call -> setFinishedAt ( new \ DateTime ( ) ) ; $ call -> setExecutionTime ( $ call -> getExecutionTime ( ) ) ; $ this -> callRepository -> update ( $ call ) ; $ this -> processRepository -> countAvgExecutionTime ( $ call -> getProcess ( ) , $ call -> getExecutionTime ( ) ) ; $ this -> processRepository -> update ( $ call -> getProcess ( ) ) ; }
Run on console command ends

@param ConsoleTerminateEvent $event
Run on console command ends