setDescription('Start the scheduler'); $this->addOption( 'nolog' , NULL , 1 | InputOption::VALUE_NONE , 'do not log (scheduler) to logfile' , NULL ); $this->addOption( 'notasklog' , NULL , 1 | InputOption::VALUE_NONE , 'do not log (tasks) to logfiles' , NULL ); $this->setHelp( "You should use launch the command and finish it with `&`" . " to return to the console\n\n" . "\tie : bin/console scheduler:start &" ); return $this; } public function execute(InputInterface $input, OutputInterface $output) { if ( ! setup::is_installed()) { $output->writeln('Phraseanet is not set up'); return 1; } try { $scheduler = new task_Scheduler(); $scheduler->run($input, $output); } catch (\Exception $e) { switch ($e->getCode()) { case task_Scheduler::ERR_ALREADY_RUNNING: // 114 : aka EALREADY (Operation already in progress) $exitCode = ERR_ALREADY_RUNNING; break; default: $exitCode = 1; // default exit code (error) break; } return $exitCode; } } }