diff --git a/src/Oro/Bundle/CronBundle/Command/CronCommand.php b/src/Oro/Bundle/CronBundle/Command/CronCommand.php index 9f60c23dc16..77213c60e1f 100644 --- a/src/Oro/Bundle/CronBundle/Command/CronCommand.php +++ b/src/Oro/Bundle/CronBundle/Command/CronCommand.php @@ -45,6 +45,18 @@ protected function execute(InputInterface $input, OutputInterface $output) if ($cronExpression->isDue()) { /** @var CronCommandInterface $command */ $command = $this->getApplication()->get($schedule->getCommand()); + + if (!$command instanceof CronCommandInterface) { + $output->writeln( + sprintf( + 'The cron command %s must be implements CronCommandInterface', + $schedule->getCommand() + ) + ); + + continue; + } + if ($command->isActive()) { $output->writeln( 'Scheduling run for command ' . $schedule->getCommand(), diff --git a/src/Oro/Bundle/WorkflowBundle/Command/HandleProcessTriggerCommand.php b/src/Oro/Bundle/WorkflowBundle/Command/HandleProcessTriggerCommand.php index ae56c85d4a0..814a6894239 100644 --- a/src/Oro/Bundle/WorkflowBundle/Command/HandleProcessTriggerCommand.php +++ b/src/Oro/Bundle/WorkflowBundle/Command/HandleProcessTriggerCommand.php @@ -5,15 +5,16 @@ use Doctrine\Common\Persistence\ObjectRepository; use Doctrine\ORM\EntityManager; -use Oro\Bundle\WorkflowBundle\Model\ProcessData; -use Oro\Bundle\WorkflowBundle\Model\ProcessHandler; use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; use Symfony\Component\Console\Input\InputInterface; - use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; -class HandleProcessTriggerCommand extends ContainerAwareCommand +use Oro\Bundle\CronBundle\Command\CronCommandInterface; +use Oro\Bundle\WorkflowBundle\Model\ProcessData; +use Oro\Bundle\WorkflowBundle\Model\ProcessHandler; + +class HandleProcessTriggerCommand extends ContainerAwareCommand implements CronCommandInterface { const NAME = 'oro:process:handle-trigger'; @@ -129,4 +130,12 @@ public function isActive() { return true; } + + /** + * {@inheritdoc} + */ + public function getDefaultDefinition() + { + return '*/5 * * * *'; + } }